reactjs.net - combine value from array with input element to create a reactjs -
i have use case need replace '_____' input tags. using reactjs.net. thought below, error.
the output is:
error: uncaught typeerror: cannot read property 'getdomnode' of undefined , uncaught error: minified exception occurred; use non-minified dev environment full error message , additional helpful warnings.
handleentry:function(){ var x = this.refs.value1.getdomnode().value; console.log(x); }, render: function () { var displayname = "abcd_____ efg _____ ijkl"; var splitthestring = displayname.split('_____'); var numofdashes = (displayname.match(/_____/g) || []).length; if (numofdashes === 2) { return <div>{splitthestring[0]} <input ref="value1" type="text" onblur={this.handleentry}/> {splitthestring[1]} <input ref="value2" type="text" onblur={this.handleentry}/> {splitthestring[2]}</div>; } else { return <div>{splitthestring[0]} <input ref="value1" type="text" onblur={this.handleentry}/></div>; } }
Comments
Post a Comment