import type { ReactNode } from 'react'; /** * Extracts only the text contents of a ReactNode *recursively*. * * Be aware that depending on the size of the node element tree this function * can ve very slow and actually throw a StackOverflow error. Shouldn't be a * problem for elements that you expect a shallow or raw text input. * * @example * // Results on `Foo Bar` * getReactNodeTextContent(