1. 1
    Use React.lazy to do code-splitting with React Suspense
    2m 42s

Use React.lazy to do code-splitting with React Suspense

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

A new way of doing code-splitting in React apps has been released in React v16.6.0. It allows us to use Suspense tag with dynamic import statements to send heavy components over the wire to the user when they are needed and not before.

In this example we are going to see how to use React.lazy and Suspense to avoid sending whole of lodash and moment JS libraries and instead do it once it's actually necessary.