Skip to content

Correct syntax for Table Component - collection.getChildren(collection.body.key) #5475

Answered by LFDanLu
calthejuggler asked this question in Q&A
Discussion options

You must be logged in to vote

I think this is a bug/something missed within the original TableCollection implementation when we introduced the new RAC collections api (in this case specifically the addition of getChildNodes/getChildren). The original TableCollection (aka the one returned by useTableState by default) doesn't actually include the body in the key map it generates hence why collection.getChildren doesn't work. You can continue using [...collection.body.childNodes] and suppress the warning for now or use [...collection].map(... instead since it should yield the body's nodes as well.

Alternatively, I'd recommend checking out the RAC Table component if you want to render a table but style it more easily with…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@calthejuggler
Comment options

Answer selected by calthejuggler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants