Browse Source

Use correct component name in context doc example (#740)

* Use correct component name in context doc example

I'm assuming the intention was to reference the `FancyButton` component defined directly above, unless I'm misunderstanding how to read this example.

* Prettier
main
Christian Maughan Tegnér 7 years ago
committed by Dan Abramov
parent
commit
b1d705ad60
  1. 4
      examples/context/forwarding-refs-fancy-button.js

4
examples/context/forwarding-refs-fancy-button.js

@ -11,6 +11,8 @@ class FancyButton extends React.Component {
// highlight-range{1,3} // highlight-range{1,3}
export default React.forwardRef((props, ref) => ( export default React.forwardRef((props, ref) => (
<ThemeContext.Consumer> <ThemeContext.Consumer>
{theme => <Button {...props} theme={theme} ref={ref} />} {theme => (
<FancyButton {...props} theme={theme} ref={ref} />
)}
</ThemeContext.Consumer> </ThemeContext.Consumer>
)); ));

Loading…
Cancel
Save