*UPDATE* – October 28, 2018
Refer to the updated post, Loading React Components Dynamically on Demand using React.lazy if you are using
switch statement when displaying React components.
Then I ran into a dynamic import().
I will show you 3 ways to use
import() to dynamically load React Components.
- Loading React Components Dynamically – Demo – Source Code
- Handling Different Data Types – Demo – Source Code
- Loading Components on Demand – Demo – Source Code
Let’s dive in 🏊~