diff --git a/examples/context/multiple-contexts.js b/examples/context/multiple-contexts.js
index c8833d63..73737d37 100644
--- a/examples/context/multiple-contexts.js
+++ b/examples/context/multiple-contexts.js
@@ -6,31 +6,40 @@ const ThemeContext = React.createContext('light');
// highlight-next-line
const UserContext = React.createContext();
+// An intermediate component that depends on both contexts
+const Toolbar = props => {
+ // highlight-range{2-10}
+ return (
+
+ {theme => (
+
+ {user => (
+
+ )}
+
+ )}
+
+ );
+};
+
class App extends React.Component {
static propTypes = {
theme: PropTypes.string,
signedInUser: PropTypes.shape({
id: number,
name: string,
- avatar: string,
}),
};
render() {
- // highlight-range{9}
+ const {signedInUser, theme} = this.props;
+
+ // App component that provides initial context values
+ // highlight-range{2-3,5-6}
return (
-
-
-
- {theme => (
-
- {user => (
-
- )}
-
- )}
-
+
+
+
);