ICT30016-Assignment-3/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
dlawler489 a79a6afd34 intial
intial
2025-09-16 12:09:52 +10:00

14 lines
436 B
JavaScript

import { Children, isValidElement } from 'react';
const getChildKey = (child) => child.key || "";
function onlyElements(children) {
const filtered = [];
// We use forEach here instead of map as map mutates the component key by preprending `.$`
Children.forEach(children, (child) => {
if (isValidElement(child))
filtered.push(child);
});
return filtered;
}
export { getChildKey, onlyElements };