Skip to content

Commit

Permalink
Add clarification to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
minznerjosh committed Jan 7, 2019
1 parent 58c57de commit 041cdc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/ShallowWrapper/dive.md
Expand Up @@ -51,7 +51,7 @@ expect(wrapper.find(Bar).dive().find('.in-bar')).to.have.lengthOf(1);

#### Common Gotchas

- If you _only_ dive a `<Consumer />` (even if there is a `<Provider />` in your component tree) you always get the default context value. If you want the `<Consumer />` to receive your `<Provider />`'s `value` you must first `.dive()` the `<Provider>`, the `.dive()` the `<Consumer />`.
- When using the `React.createContext()` API, if you _only_ dive a `<Consumer />` (even if there is a `<Provider />` in your component tree) you always get the default context value. If you want the `<Consumer />` to receive your `<Provider />`'s `value` you must first `.dive()` the `<Provider>`, then `.dive()` the `<Consumer />`.
```jsx
const { Provider, Consumer } = React.createContext('foo');
function MyComponent() {
Expand Down

0 comments on commit 041cdc0

Please sign in to comment.