Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react router lazy load

 const Home = React.lazy(() => import("./Home"));
 
<Route
            path="home/*"
            element={
              <React.Suspense fallback={<>...</>} >
                <Home />
              </React.Suspense>
            }
          />
 
PREVIOUS NEXT
Tagged: #react #router #lazy #load
ADD COMMENT
Topic
Name
9+1 =