Skip to content

Instantly share code, notes, and snippets.

@whisher
Created October 23, 2018 07:01
Show Gist options
  • Save whisher/04641e4f0e9a4ba2cf8b4f8283582e0e to your computer and use it in GitHub Desktop.
Save whisher/04641e4f0e9a4ba2cf8b4f8283582e0e to your computer and use it in GitHub Desktop.
const AuthLayoutMain = Loadable({
loader: () => import('./features/auth/layout'),
loading: Loading
});
<Route path={AUTH} component={AuthLayoutMain} />
react.development.js?72d0:247 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `LoadableComponent`.
in LoadableComponent (created by Route)
in Route (created by App)
in Switch (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in MuiThemeProvider (created by App)
in App
in Provider
react-dom.development.js?61bb:55 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `LoadableComponent`.
at invariant (react-dom.development.js?61bb:55)
at createFiberFromElement (react-dom.development.js?61bb:9966)
at reconcileSingleElement (react-dom.development.js?61bb:12922)
at reconcileChildFibers (react-dom.development.js?61bb:12979)
at reconcileChildren (react-dom.development.js?61bb:13391)
at finishClassComponent (react-dom.development.js?61bb:13557)
at updateClassComponent (react-dom.development.js?61bb:13501)
at beginWork (react-dom.development.js?61bb:14090)
at performUnitOfWork (react-dom.development.js?61bb:16416)
at workLoop (react-dom.development.js?61bb:16454)
react-dom.development.js?61bb:14550 The above error occurred in the <LoadableComponent> component:
in LoadableComponent (created by Route)
in Route (created by App)
in Switch (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in MuiThemeProvider (created by App)
in App
in Provider
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment