React.createRef()
в классовых компонентах?class MyComponent extends React.Component {
myRef = null
render() {
return <div ref={ref => myRef = ref} />;
}
}
class MyComponent extends React.Component {
myRef = React.createRef();
render() {
return <div ref={myRef} />;
}
}