react#lazy JavaScript Examples

The following examples show how to use react#lazy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: routes.js    From cra-template-redux-auth-starter with MIT License 6 votes vote down vote up
routes = [
  {
    path: 'dashboard',
    component: lazy(() => import('features/Dashboard')),
    exact: true,
  },
  {
    path: 'users',
    component: lazy(() => import('features/Users')),
    exact: true,
  },
]
Example #2
Source File: loadable.js    From QiskitFlow with Apache License 2.0 6 votes vote down vote up
loadable = (importFunc, { fallback = null } = { fallback: null }) => {
  const LazyComponent = lazy(importFunc);

  return props => (
    <Suspense fallback={fallback}>
      <LazyComponent {...props} />
    </Suspense>
  );
}
Example #3
Source File: index.js    From defizap-frontend with GNU General Public License v2.0 6 votes vote down vote up
configureStore = (initialState, history) => {
  const middlewares = [thunk, routerMiddleware(history)];
  const storeEnhancers = [];

  const isDev = process.env.NODE_ENV !== 'production';
  if (isDev) {
    // allow devs to use their own plugged in browser redux dev tool instead of the builtin component
    const devTools = DevTools();
    const devToolsEnhancer = window.__REDUX_DEVTOOLS_EXTENSION__
      ? window.__REDUX_DEVTOOLS_EXTENSION__()
      : devTools.instrument();
    storeEnhancers.push(devToolsEnhancer);
  }

  const middlewareEnhancer = applyMiddleware(...middlewares);
  storeEnhancers.unshift(middlewareEnhancer);

  const store = createStore(
    rootReducer(history),
    initialState,
    compose(...storeEnhancers)
  );

  if (isDev && module.hot && module.hot.accept) {
    module.hot.accept('../reducers', () => {
      const nextRootReducer = lazy(() => import('../reducers'));
      store.replaceReducer(nextRootReducer);
    });
  }
  return store;
}
Example #4
Source File: DeviceDetail.js    From edge-frontend with Apache License 2.0 5 votes vote down vote up
ImageInformationCard = lazy(() => import('./ImageInformationCard'))
Example #5
Source File: ReduxApp.js    From Black-IDE with GNU General Public License v3.0 5 votes vote down vote up
Header = lazy(() =>
  import('./components/Header' /* webpackChunkName: "header" */)
)
Example #6
Source File: ReduxApp.js    From CKB-Studio with GNU General Public License v3.0 5 votes vote down vote up
Header = lazy(() => import('./components/Header' /* webpackChunkName: "components" */))
Example #7
Source File: App.js    From ConfluxStudio with GNU General Public License v3.0 5 votes vote down vote up
ReduxApp = lazy(() => import('./ReduxApp' /* webpackChunkName: "components" */))
Example #8
Source File: App.js    From SubstrateIDE with GNU General Public License v3.0 5 votes vote down vote up
ReduxApp = lazy(() => import('./ReduxApp' /* webpackChunkName: "components" */))
Example #9
Source File: App.js    From MERN-Blog-App with MIT License 5 votes vote down vote up
Landing = lazy(() => import("./components/Landing"))
Example #10
Source File: Routes.js    From access-requests-frontend with Apache License 2.0 5 votes vote down vote up
AccessRequestsPage = lazy(() => import('./Routes/AccessRequestsPage'))
Example #11
Source File: Routes.js    From content-preview with Apache License 2.0 5 votes vote down vote up
List = lazy(() => import(/* webpackChunkName: "List" */ './SmartComponents/Recs/List'))
Example #12
Source File: Routes.js    From dbaas-ui with Apache License 2.0 5 votes vote down vote up
HomePage = lazy(() =>
  import(/* webpackChunkName: "HomePage" */ './Routes/HomePage')
)
Example #13
Source File: DeviceDetail.js    From edge-frontend with Apache License 2.0 5 votes vote down vote up
GeneralInformation = lazy(() =>
  import(
    '@redhat-cloud-services/frontend-components-inventory-general-info/GeneralInformation'
  )
)
Example #14
Source File: Routes.js    From user-preferences-frontend with Apache License 2.0 5 votes vote down vote up
Email = lazy(() =>
  import(
    /* webpackChunkName: "Email" */ './PresentationalComponents/Email/Email'
  )
)
Example #15
Source File: ResultClassRoute.js    From sampo-ui with MIT License 5 votes vote down vote up
Export = lazy(() => import('./Export'))
Example #16
Source File: App.js    From instaclone with Apache License 2.0 5 votes vote down vote up
NotFoundPage = lazy(() =>
  import('../../pages/NotFoundPage/NotFoundPage')
)
Example #17
Source File: Routes.js    From user-preferences-frontend with Apache License 2.0 5 votes vote down vote up
Notification = lazy(() =>
  import(
    /* webpackChunkName: "Notification" */ './PresentationalComponents/Notification/Notification'
  )
)
Example #18
Source File: index.js    From ocp-advisor-frontend with Apache License 2.0 5 votes vote down vote up
RecsListTable = lazy(() =>
  import(/* webpackChunkName: 'RulesTable' */ '../RecsListTable/')
)
Example #19
Source File: Routes.js    From malware-detection-frontend with Apache License 2.0 5 votes vote down vote up
List = lazy(() => import(/* webpackChunkName: 'Signature List' */ './Signatures'))
Example #20
Source File: index.js    From sed-frontend with Apache License 2.0 5 votes vote down vote up
AboutRemoteHostConfigPopover = lazy(() =>
  import(
    /* webpackChunkName: "ConnectSysAboutRemoteHostConfigPopovertemsModal" */ '../../Components/AboutRemoteHostConfigPopover/AboutRemoteHostConfigPopover'
  )
)
Example #21
Source File: Routes.js    From tasks-frontend with Apache License 2.0 5 votes vote down vote up
CompletedTaskDetails = lazy(() =>
  import(
    /* webpackChunkName: "CompletedTaskDetails" */ './SmartComponents/CompletedTaskDetails/CompletedTaskDetails'
  )
)
Example #22
Source File: Routes.js    From sed-frontend with Apache License 2.0 5 votes vote down vote up
ActivationKeys = lazy(() => import('./Components/ActivationKeys'))
Example #23
Source File: Routes.js    From ocp-advisor-frontend with Apache License 2.0 5 votes vote down vote up
RecsList = lazy(() =>
  import(/* webpackChunkName: "RecsList" */ './Components/RecsList')
)