Welcome aboard! We are happy you are here and wish you good net-raft!
import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
constructor() {
super();
this.findDomNodeHandler = this.findDomNodeHandler.bind(this);
};
findDomNodeHandler() {
var myDiv = document.getElementById('myDiv');
ReactDOM.findDOMNode(myDiv).innerText = 'Hello all!';
}
render() {
return (
<div>
<button onClick = {this.findDomNodeHandler}>Click</button>
<div id = "myDiv">Hello world!</div>
</div>
);
}
}
export default App;
The most helpful REACT solutions