Files
SnowLuma/.pnpm-store/v11/files/28/16e2d467303bf12e1ff87599a15c233290cf2a60ebb5f43c6871ec5358f80e4812fbe6d19c35a89dab365dfe31df96ca97b941247be75ace241d1b91cd1306
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

16 lines
471 B
Plaintext

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 };
//# sourceMappingURL=utils.mjs.map