Getting this error at the moment:
Uncaught TypeError: Cannot read property 'value' of null
I call this in my render function below:
<input type="submit" className="nameInput" id="name" value="cp-dev1" onClick={this.writeData}/>
I also have tried calling it in here
componentWillMount: function(){
var name = document.getElementById('name').value;
},
How can I get the id of an input text field and read that value and ensure it is not null?
I think the DOM is loading after I try to read the element hence why it is null