Next.js Discord

Discord Forum

`Error: Objects are not valid as a React child (found: [object Promise])` when testing RSC

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
When React Server Component is rendered inside testing library render method an error
Error: Objects are not valid as a React child (found: [object Promise])
is returned. When only the outermost component is async then it can be used like this:
render(await TheComponent())
However when TheComponent has async child component this method doesn't work. Is there any fix for this?

0 Replies