Created
October 30, 2019 22:36
-
-
Save mjackson/caefdc626afb9f0c08b610740e5e8016 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import { lazy } from 'react-suspense-resource'; | |
let Courses = lazy(() => import('./Courses.js')); | |
let CoursesIndex = lazy(() => import('./CoursesIndex.js')); | |
let routes = [ | |
{ | |
path: "courses", | |
element: <Courses />, | |
routes: [ | |
{ | |
path: ":id", | |
element: <Course />, | |
preload: ({ params: { id } }) => getCourse(id) | |
}, | |
{ path: "new", element: <NewCourse /> }, | |
{ path: ".", element: <CoursesIndex /> }, | |
{ path: "*", element: <CoursesNotFound /> } | |
] | |
}, | |
{ | |
path: "courses", | |
element: <Landing />, | |
routes: [ | |
{ path: "react-fundamentals", element: <ReactFundamentalsLanding /> }, | |
{ path: "advanced-react", element: <AdvancedReactLanding /> } | |
] | |
}, | |
{ path: ".", element: <Home /> } | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment