Closed sonylomo closed 3 months ago
We're improving the SEO performance of the website. Having a fallback Loader component for every page before it loads helps bump up SEO.
You could do some further reading here:
Suspense
Loader
// src/router/index.jsx import {Suspense} from 'react'; const router = createBrowserRouter([ { path: "/", element: <Suspense fallback={<div>Loading...</div>}> <Layout /> </Suspense>, children: [ { path: "/", element: <Suspense fallback={<div>Loading...</div>}> <LandingPage /> </Suspense>,, }, { path: "/products", element: <Suspense fallback={<div>Loading...</div>}> <Products /> </Suspense>, }, ... rest of code
React.lazy
const LandingPage = React.lazy(() => import('./LandingPage'));
Feel free to reach out if you have any inquiries or need more guidance.
Description
We're improving the SEO performance of the website. Having a fallback Loader component for every page before it loads helps bump up SEO.
You could do some further reading here:
Tasks
Suspense
with aLoader
fallback component of your choice i.eReact.lazy
for imports, e.g: