netlify.toml react code example
Example 1: deploy react app netlify
npm install netlify-cli -g
npm run build
netlify deploy
./build
netlify deploy --prod
Example 2: react forwardref
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>;