Skip to content

Instantly share code, notes, and snippets.

@nicholasess
Created April 30, 2018 21:11
Show Gist options
  • Save nicholasess/63c8eab33aa2c68b855d4af8a263dbb4 to your computer and use it in GitHub Desktop.
Save nicholasess/63c8eab33aa2c68b855d4af8a263dbb4 to your computer and use it in GitHub Desktop.
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