javascript - Access child component state in other ways than ref? -
i unable use this.refs.child.state in application access state of child component, hence need alternative way so. main reason pass child contents redux state when button clicked inside such childs parent component, hence function in parent component needs pass childs content 1 of parameters. depending on structure of components (hard tell when don't post code), fix chaining callbacks via props. i.e. var parent = react.createclass({ onchange: function(childvalue){ this.setstate({childvalue: childvalue}); }, render: function(){ return <child onchange={this.onchange} /> } }); var child = react.createclass({ handlechange: function(event){ this.props.onchange(event.target.value); }, render: function(){ return <input onchange={this.handlechange}/> } }); add in many middle-layers needed of form; var middlechilda = react.createclass({ render: function(){ return <middlechildb onc...