Mastodon/app/javascript/flavours/glitch/utils/has_react_children.ts
diondiondion b08e2b8e60 [Glitch] Update design of Collections list page
Port 3d5cb624ba1bf861d41f4bf42f7ecf02b010718e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-04-30 19:03:05 +02:00

13 lines
288 B
TypeScript

import { Children } from 'react';
import type { ReactNode } from 'react';
export function hasReactChildren(children: ReactNode): boolean {
if (!children) {
return false;
}
const childrenCount = Children.toArray(children).filter(Boolean).length;
return childrenCount > 0;
}