Add notes about composing multiple contexts

This commit is contained in:
Alex Krolick
2018-03-23 11:13:25 -07:00
parent d58c892169
commit e6898245d9

View File

@@ -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`