Files
ETB/ETB-FrontEnd/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

15 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 };