Created
March 23, 2017 17:26
-
-
Save danielberndt/ff3a528e388712f94447ff15773a8b3d to your computer and use it in GitHub Desktop.
Failed attempt at combining material UI and react-router-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const routes = [ | |
{label: "Home", url: "/"}, | |
{label: "Sub Page", url: "/sub"} | |
]; | |
const TabsElement = () => ( | |
<Tabs value="match">{routes.map(({label, url}) => ( | |
<Route path={url} exact>{({match}) => ( | |
<Tab label={label} value={match && "match"} containerElement={p => <Link {...p} to={url}/>}/> | |
)}</Route> | |
))}</Tabs> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment