Code-Splitting in React

Siful Islam
Nov 6, 2020

--

code-spliting in React

When we work on a large-scale project managing bundle is became a common problem. The browser needs to load the whole bundle then render data. To solve this issue code-splitting works like a gem.

Import(): Dynamic import load bundle when it needs to access. To separate it from the main bundle you can use import.

React.lazy and Suspense: You can control your elements busing lazy. The lazy will make web apps faster. Mainly, when you need the app element lazy will bring that element only that time. If it takes time you can use suspense as preloader content. You can add text or HTML elements as suspense.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Siful Islam
Siful Islam

No responses yet

Write a response