reactjs - Get an inputs component props onBlur -


is possible props of input onblur event?

with event.target.value value of input.

is possible props of component similar way?

sure can, here fiddle:

var hello = react.createclass({   onblur: function(e) {   console.log(this.props) }, render: function() {       return <div>     <input onblur={this.onblur} />   </div>; } }); 

or if receive function parent property, should bind components context.

fiddle example:

var hello = react.createclass({    render: function() {               return <div>       <input onblur={this.props.onblur.bind(this)} />     </div>;   } });  function onblur(e) {   console.log(this.props);   console.log(e); }  reactdom.render(   <hello onblur={onblur} name="world" />,   document.getelementbyid('container') ); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -