Browse Source

Add notes about composing multiple contexts

main
Alex Krolick 7 years ago
parent
commit
e6898245d9
  1. 4
      content/docs/context.md

4
content/docs/context.md

@ -91,8 +91,12 @@ A more complex example with dynamic values for the theme:
## Consuming Multiple Contexts
To keep context re-rendering fast, React needs to make each context consumer a separate node in the tree.
`embed:context/multiple-contexts.js`
If two or more context values are often used together, you might want to consider creating your own render prop component that provides both. [React Context Composer](https://github.com/FormidableLabs/react-context-composer/) is a simple library to help with this.
## Accessing Context in Lifecycle Methods
`embed:context/lifecycles.js`

Loading…
Cancel
Save