function withTheme(Component) { // highlight-next-line function ThemedComponent({forwardedRef, ...rest}) { // highlight-range{6} return ( {theme => ( )} ); } // Intercept the "ref" and pass it as a custom prop. // highlight-range{1-3} return React.forwardRef((props, ref) => ( )); } // highlight-next-line const fancyButtonRef = React.createRef(); // fancyButtonRef will now point to FancyButton // highlight-range{4} ;