I dynamically create multiple text inputs (with dynamically generated refs) along the text I want to update with input.
I am trying to get the input value by setting ref to a variable and finding the DOM node with React.findDOMNode (this.refs.Variable) .value
I get a "Can not read property" message with zero error.
How can i achieve this?
This is what the function looks like:
resetUnit: function(e){ var refID = e.target.id; var ID = refID.split("-")[0]; var Value = React.findDOMNode(this.refs.refID).value; NodesCollection.update({_id: ID},{$set: { materialUnit : Value}}); this.setState({ edit: '' }); },
source share