renderSectionOnState = () =>{
switch(this.state.activeSection){
case 'introsection':
return <IntroScreen
handleSwitchSection={this.handleSwitchSection}
activeSection={this.state.activeSection} />
break;
case 'basicinfosection':
return <BasicInfo
handleSwitchSection={this.handleSwitchSection}
activeSection={this.state.activeSection} />
break;
case 'extrainfosection':
return <ExtraInfo
activeSection={this.state.activeSection}
handleAddLikes={this.handleAddLike}
handleAddCategories={this.handleAddCategory}
selectedLikes={this.state.selectedLikes}
selectedCategories={this.state.selectedCategories}
handleAcct={this.handleAcct}
/>
break;
}
}
then in the return:
{this.renderSectionOnState()}