Lazy Motion
Reading Time:
1
min
Released
October 2, 2023
Reduce bundle size by lazy-loading a subset of Motion's features.
The LazyMotion component can help you reduce bundle size by synchronously or asynchronously loading some, or all, of the motion component's features.
By default, the motion component comes pre-bundled with all of its features. The m component can be used in exactly the same way as motion, but it comes with no features preloaded. These are then provided by LazyMotion.
This can cut initial bundle sizes down to under 5kb.
Read the Reduce bundle size guide for full usage instructions.
Props
features: FeatureBundle | LazyFeatureBundle
Can be used to provide a feature bundle synchronously or asynchronously.
strict: boolean
If true, will throw an error if a motion component renders within a LazyMotion component.
Istanbul
Follow us on social media