I did the following implementation:
import {lazy, Suspense} from 'react'
Load (lazy) my component:
const Component = lazy(() => import('./componentPath'))
Wrap the Switch in Suspense:
<Suspense fallback={<span>Loading...</span>}> <Switch> <Route exact path='/path' component={Component} //> </Switch> </Suspense>
and I hit the following issue:
On many places css is with bad margins, padding even there are some styles which are missing.
My goal is to lazy load components on Route level.
Any ideas how I can fix this? Thank you in advance