Skip to content

Instantly share code, notes, and snippets.

@danielberndt
Created March 23, 2017 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielberndt/ff3a528e388712f94447ff15773a8b3d to your computer and use it in GitHub Desktop.
Save danielberndt/ff3a528e388712f94447ff15773a8b3d to your computer and use it in GitHub Desktop.
Failed attempt at combining material UI and react-router-4
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