From e6898245d9e5d485e2ddf98df76b8baf3483cec2 Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Fri, 23 Mar 2018 11:13:25 -0700 Subject: [PATCH] Add notes about composing multiple contexts --- content/docs/context.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/docs/context.md b/content/docs/context.md index b16cb611..79ec475c 100644 --- a/content/docs/context.md +++ b/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`