Files
NapCatQQ/.pnpm-store/v3/files/90/e15560253b5852243a2a0ff3bc998f8d4f09617621b2a559ffc76a9c66ddbf5a07ab125dcc0aab594cbb41c761177963b32158d0fb5bb0ae91a9ac50a0ded9
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

15 lines
554 B
Plaintext

"use client";
import { useContext, useMemo } from 'react';
import { MotionContext } from './index.mjs';
import { getCurrentTreeVariants } from './utils.mjs';
function useCreateMotionContext(props) {
const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));
return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
}
function variantLabelsAsDependency(prop) {
return Array.isArray(prop) ? prop.join(" ") : prop;
}
export { useCreateMotionContext };