Created
January 4, 2020 23:12
-
-
Save ryanjyost/96fc99652df599e80a32ee25f9773d95 to your computer and use it in GitHub Desktop.
Example 7
This file contains hidden or 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
| /** | |
| * 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