The easiest way to achieve this is to use refs .
var Parent = React.createClass ({ triggerChildDisplay: function() { this.refs.child.display(); }, render() { <Button onClick={this.triggerChildDisplay} /> } }) var Child = React.createClass ({ getInitialState () { return { display: true }; }, display: function(){ this.setState({ display: !this.state.display }) }, render() { {this.state.display} } })
I basically copied in your example, but notice that in your parent I do not see you display the child component, but usually you would, and on this Child you would give it a link, for example <Child ref="child" /> .
David
source share