React.lazy API in 60 seconds (Code-Splitting with Suspense)

twitter logo github logo ・1 min read

twitter logo DISCUSS (13)
markdown guide
 
 

Hi,
Can this be used for static sites such as Gatsby? Because I just tried with Gatsby and I'm getting build errors.

 

I'm not sure

If you're performing server side rendering with Gatsby, then this wouldn't work (SSR isn't supported yet)

If not, make sure you're on the latest React version

 

I don't have SSR. Yes. I do have the react latest.
Can't seems to be working. anyway Thanks for the clear introduction :)

 

Straight to the point, no boring bla-bla.
Great!

 
 

Thank you for keeping it to the point, most tutorials you need to skip ahead ten minutes in to understand.

 

It's great! We need more 1-minute educational resources!

 

Awesome! But how is this different from Loadable library? Am I missing anything?

 

Compared to loadable

Pro: Comes built-in, nicer API
Con: No SSR support yet.

reactjs.org/docs/code-splitting.ht...

 

You lied! It was 56 second video 😉

That was a great intro to code-splitting with suspense.

 
Classic DEV Post from May 10

Why I ignore the hype (and you should too)

It’s been 20 years since I made my first website. I've been burned by the hype ti...

Sid profile image
Independent developer. Built react.games, tinyreact.email, metrics.coffee, bundlesize past: design systems @auth0, frontend architect @practo 📧sid.studio/newsletter 🎥youtube.com/sid-studio