I have a component with a Nav on the left side and different content on the right side. When the component "MyBookingsOverview" is loaded, I would like to set the first NavItem as active and redirect to this route. I wasn't able to find a way yet. Does anyone has a tip? Here my code:
export default class MyActivities extends Component {
render() {
return (
<Grid fluid>
<Col lg={2}>
<Nav />
</Col>
<Col lg={10}>
<Routes />
</Col>
</Grid>
);
}
}
export default class MyActivityNav extends Component {
render() {
return (
<div className="itemRequestNav">
<Nav bsStyle="pills" stacked>
<LinkContainer to={routes.ACCOUNT_ACTIVITIES_OVERVIEW}>
<NavItem>Übersicht</NavItem>
</LinkContainer>
<LinkContainer to={routes.ACCOUNT_ACTIVITIES_REQUESTS}>
<NavItem>Anfragen</NavItem>
</LinkContainer >
<LinkContainer to={routes.ACCOUNT_ACTIVITIES_BOOKINGS}>
<NavItem>Buchungen</NavItem>
</LinkContainer >
</Nav>
</div>
);
}
}
export default ({ childProps }) =>
<Switch>
<PrivateRoute exact path={routes.ACCOUNT_ACTIVITIES_OVERVIEW} component={MyRequests} />
<PrivateRoute exact path={routes.ACCOUNT_ACTIVITIES_BOOKINGS} component={MyRequests} />
<PrivateRoute exact path={routes.ACCOUNT_ACTIVITIES_REQUESTS} component={MyRequests} />
</Switch>;
Greetings, Michael