react-table-library icon indicating copy to clipboard operation
react-table-library copied to clipboard

Virtualized Table fails DOM nesting validation

Open MA-MacDonald opened this issue 3 years ago • 1 comments

Virtualized Table fails DOM nesting validation I am using the example in the docs https://react-table-library.com/?path=/docs/compact-table--virtualized

Warning: validateDOMNesting(...): <div> cannot appear as a child of <table>
Warning: validateDOMNesting(...): <thead> cannot appear as a child of <div>
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <div>
Warning: validateDOMNesting(...): <div> cannot appear as a child of <tbody>
Warning: validateDOMNesting(...): <tbody> cannot appear as a child of <div>

image

MA-MacDonald avatar Aug 07 '22 06:08 MA-MacDonald

I will update the docs, but try the following:

<Table layout={{ isDiv: true, fixedHeader: true }} ... other stuff>

Because in a virtualized table, there are div elements between the table elements, but semantically that's not allowed. Therefore we need to transform the whole table to div elements.

Let me know if this helps.

rwieruch avatar Aug 09 '22 11:08 rwieruch

Did it help @MA-MacDonald ?

rwieruch avatar Aug 31 '22 12:08 rwieruch

Closing this, because the solution to this issue is there.

rwieruch avatar Sep 02 '22 07:09 rwieruch