-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Milestone
Description
Hi 👋
I'm upgrading to use the v2 beta version on a project and had some issues around the responsive table component. My bad If I'm doing something totally wrong but looks to me like this might be something that could be tweaked.
My table is dynamically created using the react-table library and the table cell values are rendered via a method. This used to work fine in v1, but in v2 due to the responsive changes and more specifically the getHeadingsFromChildren helper, we can no longer use anything other than a string as a child of Table.Cell.
My code:
<Table.Head>
{headerGroups.map((headerGroup) => {
const { ...headerGroupProps } = headerGroup.getHeaderGroupProps()
return (
<Table.Row {...headerGroupProps} key={headerGroupProps.key}>
{headerGroup.headers.map((column) => {
const { ...headerProps } = column.getHeaderProps()
return (
<Table.Cell
{...headerProps}
key={headerProps.key}
{column.render('Header')}
</Table.Cell>
)
})}
</Table.Row>
)
})}
</Table.Head>
I fixed this for now by importing renderToString from react-dom/server but this isn't an ideal solution
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
