You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
294 B
10 lines
294 B
// highlight-range{1-2}
|
|
const FancyButton = React.forwardRef((props, ref) => (
|
|
<button ref={ref} className="FancyButton">
|
|
{props.children}
|
|
</button>
|
|
));
|
|
|
|
// You can now get a ref directly to the DOM button:
|
|
const ref = React.createRef();
|
|
<FancyButton ref={ref}>Click me!</FancyButton>;
|
|
|