score:0

Accepted answer

you have to define the ref variable in component, not under the render function.

component ... {
     myRef = React.createRef();
...
render() {
...
...
}
}

Related Query

More Query from same tag