Browse Source

Fix: added missing component instantiation within the 'forwardRef' API example

main
Tom Gallacher 7 years ago
parent
commit
17d04ac9f3
  1. 4
      examples/16-3-release-blog-post/forward-ref-example.js

4
examples/16-3-release-blog-post/forward-ref-example.js

@ -24,6 +24,10 @@ function withTheme(Component) {
return React.forwardRef(ThemedComponent);
}
// Here we assume that FancyButton has been imported into the current scope
const FancyThemedButton = withTheme(FancyButton);
// Create a ref using the new Referenace API, as above
// highlight-next-line
const fancyButtonRef = React.createRef();

Loading…
Cancel
Save