how to write ref in class component react.js code example
Example: use ref in component reactjs
function MyFunctionComponent() { return <input />;
}
class Parent extends React.Component {
constructor(props) {
super(props);
this.textInput = React.createRef(); }
render() {
// Ça ne fonctionnera pas !
return (
<MyFunctionComponent ref={this.textInput} /> );
}
}