60
rated 0 times
[
62]
[
2]
/ answers: 1 / hits: 23920
/ 10 Years ago, sat, april 12, 2014, 12:00:00
I have such render() method in my root component:
render: function() {
return (
<div className=question>
<QuestionA question={this.props.question} author={this.props.author}/>
<QuestionB yes={this.state.yes} no={this.state.no} />
<div className=question-side-switcher onClick={this.handleSideChanging}></div>
</div>
);
}
Where I want to toggle the 'active' class between QuestionA and QuestionB components when user clicked the button. How can I do this? Keep in mind, that QuestionA and QuestionB are set their own classNames in their render() methods. For example QuestionB's render():
render: function() {
return (
<section className=question-b-container>
...
</section>
);
}
More From » class