I used 'react-bootstrap' in my application. I used Tab Component. I want onSelect function of tabs component.
Below is my code for the component
export default class Users extends Component {
handleSelect() {
console.log("Tab selected")
}
render() {
return(
<div className="welcome-wrap">
<br />
<div className="row">
<h3>Users</h3>
<Tabs defaultActiveKey={1} animation={false} id="user-role-tab">
<Tab eventKey={1} title="Root Users" className="
" onSelect={this.handleSelect()}>
<RootUser/>
</Tab>
<Tab eventKey={2} title="Organization Users" onSelect={this.handleSelect()}>
<OrganizationUser/>
</Tab>
<Tab eventKey={3} title="Business Users" onSelect={this.handleSelect()}>
<BusinessUser/>
</Tab>
</Tabs>
</div>
</div>
)
}
}
It's working when the component is loaded but when I click on any tab the function is not called. I checked the solution of How to call an event on tabs changed in react-bootstrap but it's also not working.