Skip to content

Instantly share code, notes, and snippets.

@ryanjyost
Created January 4, 2020 23:12
Show Gist options
  • Select an option

  • Save ryanjyost/96fc99652df599e80a32ee25f9773d95 to your computer and use it in GitHub Desktop.

Select an option

Save ryanjyost/96fc99652df599e80a32ee25f9773d95 to your computer and use it in GitHub Desktop.
Example 7
/**
* Use this component for any new section of routes (any config object that has a "routes" property
*/
export function RenderRoutes({ routes }) {
return (
<Switch>
{routes.map((route, i) => {
return <RouteWithSubRoutes key={route.key} {...route} />;
})}
<Route component={() => <h1>Not Found!</h1>} />
</Switch>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment