From f7cf140607438481237e41feb0b7bc019ec9b6d4 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 4 Apr 2018 15:21:15 +0100 Subject: [PATCH] Tweak context docs (#766) --- .../context/forwarding-refs-fancy-button.js | 2 +- .../context/higher-order-component-usage.js | 2 - examples/context/motivation-problem.js | 23 +++++---- examples/context/motivation-solution.js | 49 +++++++++++-------- examples/context/multiple-contexts.js | 45 ++++++++++------- .../context/reference-caveats-solution.js | 1 + 6 files changed, 68 insertions(+), 54 deletions(-) diff --git a/examples/context/forwarding-refs-fancy-button.js b/examples/context/forwarding-refs-fancy-button.js index 9e8f6d86..f3be5da8 100644 --- a/examples/context/forwarding-refs-fancy-button.js +++ b/examples/context/forwarding-refs-fancy-button.js @@ -8,7 +8,7 @@ class FancyButton extends React.Component { // Use context to pass the current "theme" to FancyButton. // Use forwardRef to pass refs to FancyButton as well. -// highlight-range{1,3} +// highlight-range{1,4} export default React.forwardRef((props, ref) => ( {theme => ( diff --git a/examples/context/higher-order-component-usage.js b/examples/context/higher-order-component-usage.js index e9ebb22d..6f2757de 100644 --- a/examples/context/higher-order-component-usage.js +++ b/examples/context/higher-order-component-usage.js @@ -1,7 +1,5 @@ function Button({theme, ...rest}) { - // highlight-next-line return