interface LazyProps {
    children?: ReactNode;
    features: FeatureBundle | LazyFeatureBundle;
    strict?: boolean;
}

Properties

children?: ReactNode
features: FeatureBundle | LazyFeatureBundle

Can be used to provide a feature bundle synchronously or asynchronously.

// features.js
import { domAnimation } from "framer-motion"
export default domAnimation

// index.js
import { LazyMotion, m } from "framer-motion"

const loadFeatures = import("./features.js")
.then(res => res.default)

function Component() {
return (
<LazyMotion features={loadFeatures}>
<m.div animate={{ scale: 1.5 }} />
</LazyMotion>
)
}
strict?: boolean

If true, will throw an error if a motion component renders within a LazyMotion component.

// This component will throw an error that explains using a motion component
// instead of the m component will break the benefits of code-splitting.
function Component() {
return (
<LazyMotion features={domAnimation} strict>
<motion.div />
</LazyMotion>
)
}

Generated using TypeDoc