framer-motion
Version:
A simple and powerful React animation library
39 lines (38 loc) • 1.01 kB
TypeScript
/// <reference types="react" />
import { LazyProps } from "./types";
/**
* Used in conjunction with the `m` component to reduce bundle size.
*
* `m` is a version of the `motion` component that only loads functionality
* critical for the initial render.
*
* `LazyMotion` can then be used to either synchronously or asynchronously
* load animation and gesture support.
*
* ```jsx
* // Synchronous loading
* import { LazyMotion, m, domAnimations } from "framer-motion"
*
* function App() {
* return (
* <LazyMotion features={domAnimations}>
* <m.div animate={{ scale: 2 }} />
* </LazyMotion>
* )
* }
*
* // Asynchronous loading
* import { LazyMotion, m } from "framer-motion"
*
* function App() {
* return (
* <LazyMotion features={() => import('./path/to/domAnimations')}>
* <m.div animate={{ scale: 2 }} />
* </LazyMotion>
* )
* }
* ```
*
* @public
*/
export declare function LazyMotion({ children, features, strict }: LazyProps): JSX.Element;