-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the feature you'd like:
As a user of react 18 with NextJS (with app directory), I would like to render async server components
example:
// Page.tsx
const Page = async ({ params, searchParams }: PageProps) => {
const asyncData = await fetchSomeDataAsynchronously()
return (<foo {...asyncData} />
}
...
// Page.test.tsx
it('should render', () => {
render(<Page />)
expect(screen....).ToBe(....)
})
Extracting server page logic would be an alternative, but I think that would also significantly reduce the purpose of RTL if that were to become an encouraged architectural default.
Current progress, workarounds, and demo
Gpx, nickserv, gweinert, kasperpeulen, uri-ustrell and 119 moresilverwindr100-stack, abdev1010, LRNZ09, Yimiprod, daniel-digital-innovation and 6 more