Browse Source

fix: api links in content (#4806)

* fix: api reference links in content

* fix: link on react dom api page
main
Akul Srivastava 3 years ago
committed by GitHub
parent
commit
f67fa22cc1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/pages/apis/index.md
  2. 2
      beta/src/pages/apis/reactdom.md
  3. 6
      beta/src/pages/apis/usecontext.md

2
beta/src/pages/apis/index.md

@ -30,7 +30,7 @@ import * as React from 'react';
</PackageImport>
If you use React on the web, you'll also need the same version of [ReactDOM](/api/reactdom).
If you use React on the web, you'll also need the same version of [ReactDOM](/apis/reactdom).
## Exports {/*exports*/}

2
beta/src/pages/apis/reactdom.md

@ -30,7 +30,7 @@ import * as ReactDOMClient from 'react-dom/client';
</PackageImport>
You'll also need to install the same version of [React](/api/).
You'll also need to install the same version of [React](/apis/).
## Browser Support {/*browser-support*/}

6
beta/src/pages/apis/usecontext.md

@ -927,7 +927,7 @@ ul, li { margin: 0; padding: 0; }
### Specifying a fallback default value {/*specifying-a-fallback-default-value*/}
If React can't find any providers of that particular <CodeStep step={1}>context</CodeStep> in the parent tree, the context value returned by `useContext()` will be equal to the <CodeStep step={3}>default value</CodeStep> that you specified when you [created that context](/api/createcontext):
If React can't find any providers of that particular <CodeStep step={1}>context</CodeStep> in the parent tree, the context value returned by `useContext()` will be equal to the <CodeStep step={3}>default value</CodeStep> that you specified when you [created that context](/apis/createcontext):
```js [[1, 1, "ThemeContext"], [3, 1, "null"]]
const ThemeContext = createContext(null);
@ -1337,11 +1337,11 @@ function MyComponent() {
#### Parameters {/*parameters*/}
* `SomeContext`: The context that you've previously created with [`createContext`](/api/createcontext). The context itself does not hold the information, it only represents the kind of information you can provide or read from components.
* `SomeContext`: The context that you've previously created with [`createContext`](/apis/createcontext). The context itself does not hold the information, it only represents the kind of information you can provide or read from components.
#### Returns {/*returns*/}
`useContext` returns the context value for the calling component. It is determined as the `value` passed to the closest `SomeContext.Provider` above the calling component in the tree. If there is no such provider, then the returned value will be the `defaultValue` you have passed to [`createContext`](/api/createcontext) for that context. The returned value is always up-to-date. React automatically re-renders components that read some context if it changes.
`useContext` returns the context value for the calling component. It is determined as the `value` passed to the closest `SomeContext.Provider` above the calling component in the tree. If there is no such provider, then the returned value will be the `defaultValue` you have passed to [`createContext`](/apis/createcontext) for that context. The returned value is always up-to-date. React automatically re-renders components that read some context if it changes.
#### Caveats {/*caveats*/}

Loading…
Cancel
Save