bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow changing the innerElementType

pupudu opened this issue · comments

I am using this amazing library with react-window to create a virtualized table component. One issue I am facing as of now is the validateDomNesting warning I get because of the AutoSizer.

Basically, I am experimenting a feature to allow custom element types for the windowed table. And passing element types like p or tr causes warnings from React since the AutoSizer always renders div tags.

Would it be possible to allow changing the innerElementType of the Autosizer components(similar to how it is being done for components like FixedSizeList)?

Thank you very much.

PS: The feature I am working on works exactly as I expect, except for the following warning,

Warning: validateDOMNesting(...): <div> cannot appear as a child of <tr>.
    in div (created by AutoSizer)
    in AutoSizer (at VirtualTable.js:13)

Allowing to replace div with tbody would be helpful.

@Toub I don't think this will ever become a thing. I ended up copying the source code to my library and modifying the tags instead. I think for you, the best option is to fork this repo and publish a new package to npm

Right. This package looks to be unmaintained. :-|

Added in 5752a53; will release in 1.0.9