Skip to content

✨Add support for composite components in nextjs #3723

@oddvernes

Description

Ref this issue #3702, our initial attempt to add 'use client' would not work in next.js, instead we discovered that sub components (such as Table.Header) are undefined.

@sebastianvitterso started this discussion at vercel and then discovered this article which gets to the bottom of the problem and proposes a couple of solutions.

I think most realistically, exporting the subcomponents individually is how we should go about it. This is also how they've done it over at Designsystemet (example).

Note also that individual exports have been requested in the past, but then the reasoning was to easier create jest tests downstream, so we denied the request for being not worth the effort. However, supporting ssr is perhaps a bit more important, so we should reconsider.

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions