I use the React to write this demo. I use the Webpack to build this demo.When I start this demo, the error will show me.
The error:
Uncaught
try following:
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
class App extends React.Compoment {
constructor(props){
super(props);
this.myTextInput = this.myTextInput.bind(this);
this.handleClick = this.handleClick.bind(this);
}
handleClick(){
if(this.myTextInput !=null) {
this.myTextInput.focus();
}
}
render (){
return (
this.myTextInput = ref} />
);
}
}
ReactDOM.render( , document.getElementById('app'));