Skip to content
public-library›Rules›React›Load heavy optional code on demand

Load heavy optional code on demand

Load large components, libraries, and data that the first screen does not need with a dynamic import, such as React.lazy, next/dynamic, or import(), when the user needs them. Start loading early when the user signals intent, so the wait is short.

In the full rule