Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139863

React - Suspense not fully loaded scss

$
0
0

I did the following implementation:

import {lazy, Suspense} from 'react'
  1. Load (lazy) my component:

    const Component = lazy(() => import('./componentPath'))

  2. 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


Viewing all articles
Browse latest Browse all 139863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>