React Suspense with React Router - CSS properties not working after using Suspense and Lazy

Viewed 10

My code is working fine and the css properties is working normally but whenever I change wrap the code with suspense the page loads and the suspense works but the css properties attached to them aren't working but if I remove the suspense it's working fine...

Does Anybody have an idea of what I'm doing wrong or what I'm not doing.....

import {Suspense, lazy} from "react"

const Page = lazy(()=> import('./Page'))

function App(){
<Suspense fallback={<h1>loading...</h1>}>
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<Page/>}
    </Routes>
  <BrowserRouter/>
</Suspense>
}
0 Answers
Related