Loadable is a higher-order component (a function that creates a component) which makes it easy to split up bundles on a component level.
Let’s imagine two components, one that imports and renders another.
Right now we are depending on
AnotherComponent being imported synchronously via
import. We need a way to make it loaded asynchronously.
However, this is a bunch of manual work, and it doesn’t even handle a lot of different cases. What about when the
import() fails? What about server-side rendering?
Instead you can use
... read the whole story at medium.com.
Loadable to abstract away the problem. Using Loadable is simple. All you need to do is pass in a function which loads your component and a “Loading” component to show while your component loads.