reactjs - How can I call forceUpdate on the root element in React? -
i need call forceupdate on app root of react app or on component 1 in. know call forceupdate on current component this.forceupdate()
, how call on component?
you can pass this.forceupdate()
function vis props child component
root.js
var root = react.createclass({ render: function() { return ( <updatecomponent rootupdate={this.forceupdate.bind(this)} /> ); } });
then can access call this.props.rootupdate()
in updatecomponent whenever need root force updated.
Comments
Post a Comment