Skip to content

AlonMiz/retry-react-lazy

Repository files navigation

Retry dynamic imports with Lazy react

Read this article to understand the details

Usage

const LazyAbout = LazyReact(() => import("./components/About"));
const LazyHome = LazyReact(() => import("./components/Home"));

const App = () => (
  <Router>
    <Suspense fallback={<div>Loading...</div>}>
      <Routes>
        <Route path="/" element={<LazyHome />} />
        <Route path="/about" element={<LazyAbout />} />
      </Routes>
    </Suspense>
  </Router>
);

Working module

you can find an npm module here by @fatso83 https://github.com/fatso83/retry-dynamic-import

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published