Created
April 30, 2018 21:11
-
-
Save nicholasess/63c8eab33aa2c68b855d4af8a263dbb4 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 { asyncComponent } from "@jaredpalmer/after"; | |
export default [ | |
{ | |
path: "/", | |
exact: true, | |
component: asyncComponent({ | |
loader: () => import("./Home"), // required | |
Placeholder: () => <div>...LOADING...</div> // this is optional, just returns null by default | |
}) | |
}, | |
{ | |
path: "/c/:id", | |
exact: true, | |
component: asyncComponent({ | |
loader: () => import("./Category"), // required | |
Placeholder: () => <div>...LOADING...</div> // this is optional, just returns null by default | |
}) | |
}, | |
{ | |
path: "/p/:id", | |
exact: true, | |
component: asyncComponent({ | |
loader: () => import("./Product"), // required | |
Placeholder: () => <div>...LOADING...</div> // this is optional, just returns null by default | |
}) | |
}, | |
{ | |
component: asyncComponent({ | |
loader: () => import("./Product"), // required | |
Placeholder: () => <div>...LOADING...</div> // this is optional, just returns null by default | |
}) | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment