The syntax for the new rotuer syntax uses the Link component to navigate routes. But how can this be combined with materiaul-ui ?
In my case, I use tabs as the main navigation system. Therefore, theoretically, I should have something like this:
const TabLink = ({ onClick, href, isActive, label }) => <Tab label={label} onActive={onClick} /> export default class NavBar extends React.Component { render () { return ( <Tabs> <Link to="/">{params => <TabLink label="Home" {...params}/>}</Link> <Link to="/shop">{params => <TabLink label="shop" {...params}/>}</Link> <Link to="/gallery">{params => <TabLink label="gallery" {...params}/>}</Link> </Tabs> ) } }
But when it displays, material-ui throws an error that the Tabs child must be a Tab component. What could be the way? How do I manage an isActive tab for a tab?
Thanks in advance
material-ui react-router-v4
Daniel Ramos
source share