I use this component here all very cool and beautiful, but instead of displaying nested blocks, I want to implement routing using react-router when clicking on a tab. If I just wrap the tab in the Link tag, then the styles disappear, but I don’t want it. How to achieve beautiful routing using tabs?
Here in this code, link styles overwrite tab styles, but I don’t want to.
import React from 'react'; import {Tabs, Tab} from 'material-ui/Tabs'; import SwipeableViews from 'react-swipeable-views'; import {Link, IndexLink} from 'react-router'; import CommonStyles from './CommonStyles'; class TabMenu extends React.Component { constructor(props) { super(props); this.state = { slideIndex: 0, }; } render() { return ( <div> <Tabs onChange={this.handleChange} value={this.state.slideIndex} > <Link to="/"> <Tab label="Main" style={styles.slide} value={0} /> </Link> <Tab label="Tests" style={styles.slide} value={1} /> <Tab label="Videos" style={styles.slide} value={2} /> </Tabs> </div> ); } } export default TabMenu;