score:6

the tab container, replaced defaultkey with activekey={this.state.key}, and managed the state of the parent with a function, passed as a prop to componenta.

on the parent of the tab.container

 handleselect(key){
    this.setstate({ key : key })
 }

 render() {
    ... render stuff ...

    return (
       <tab.container id="tabcontainer" activekey={this.state.key}>
            <tab.content animation>
              <tab.pane eventkey="a">
                <componenta changetab={this.handleselect}/>
              </tab.pane>
              <tab.pane eventkey="b">
                <componentb />
              </tab.pane>
            </tab.content>
            <nav stacked bsstyle="pills" pullleft>
               ... navitems ...
            </nav>
        <tab.container>
    )
 }

and on the component a

eventhandler(){
   this.props.changetab("b")
}

Related Query

More Query from same tag