Grokking React Advanced
0% completed
Implementing Dynamic Imports
An import statement at the top of a file and an import() call inside a function look similar, but they behave differently. The statement is resolved before any of your code runs, so the module is always part of the program. The call runs only when the line is reached, returns a promise, and lets the bundler put the module in a separate chunk. That call is a dynamic import. It looks like a function call, but it is part of the language syntax, and it is plain JavaScript, not a React feature. `lazy
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%