import React , { ReactNode } from "react" ; export function isReactNode ( node ) { return React . isValidElement ( node ) || Array . isArray ( node ) && node . every ( isReactNode ) || node == null || typeof node !== "object" ; }