imk/node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs

15 lines
434 B
JavaScript

import { isWillChangeMotionValue } from './is.mjs';
function addValueToWillChange(visualElement, key) {
const willChange = visualElement.getValue("willChange");
/**
* It could be that a user has set willChange to a regular MotionValue,
* in which case we can't add the value to it.
*/
if (isWillChangeMotionValue(willChange)) {
return willChange.add(key);
}
}
export { addValueToWillChange };