Type-based methods such as getChildrenByTypeDeep don't seem to work when using React Server Components (specifically with the Next.js 13 app directory), even when using customTypeKey or 'use client' in all children of a Server Component.
For example:
const Example = () => <p>Hello World!</p>
const Wrapper = ({ children }) => {
const filtered = getChildrenByType(children, Example)
console.log(filtered.length)
return children
}
Type-based methods such as
getChildrenByTypeDeep
don't seem to work when using React Server Components (specifically with the Next.js 13 app directory), even when usingcustomTypeKey
or'use client'
in all children of a Server Component.For example: