-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/update ApolloProvider docs (#6625)
* remove unused ApolloProvider mdx import * inline apollo-provider.mdx into hooks.mdx and update This removes some instructions and updates the example code to use `@apollo/client`. The code was inlined because it is no longer shared and as a workaround for a possibly unrelated issue.
- Loading branch information
1 parent
4a724ff
commit e500683
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
The `ApolloProvider` component leverages [React's Context API](https://reactjs.org/docs/context.html) to make a configured Apollo Client instance available throughout a React component tree. This component can be imported directly from the `@apollo/react-common` package where it lives, or from one of the `@apollo/react-hooks`, `@apollo/react-components`, and `@apollo/react-hoc` packages. | ||
|
||
```js | ||
import { ApolloProvider } from '@apollo/react-hooks'; | ||
``` | ||
|
||
### Props | ||
|
||
| Option | Type | Description | | ||
| -------- | -------------------------- | --------------------------- | | ||
| `client` | ApolloClient<TCache> | An `ApolloClient` instance. | | ||
|
||
### Example | ||
|
||
```jsx | ||
ReactDOM.render( | ||
<ApolloProvider client={client}> | ||
<MyRootComponent /> | ||
</ApolloProvider>, | ||
document.getElementById('root'), | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters