Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Doesn't work with React-hot-loader #338

Open
patrik-piskay opened this issue Dec 2, 2016 · 4 comments · May be fixed by #395
Open

Doesn't work with React-hot-loader #338

patrik-piskay opened this issue Dec 2, 2016 · 4 comments · May be fixed by #395

Comments

@patrik-piskay
Copy link

When using RHL (version 3.0.0-beta6), error The only possible children of <Table> are <Thead>, <Tr>, or one <Tfoot> is thrown with no table being rendered.

@gbenson-wikia
Copy link

This appears to be caused by reactable/table.jsx::parseChildData()'s mechanism for checking to see if the children are the types it's expecting. child.type returns the function used to create the child component, and RHL will have swapped out the function with a copy of itself. But, since they merely contain the same code (and don't point to the same in-memory instance of the function), JS doesn't see them as being the same function.

I'm unsure that this is something that RHL would be able to fix, though it's probably worth opening a ticket over there, too.

I think there's an easy fix for this on the reactable side, where reactable adds add a "reactable component type" static string variable to each of the reactable components, and checks against that in the switch instead.

@glittershark - If you'd be open to this as an approach, I can try to put together a PR. What do you think?

@bf
Copy link

bf commented Jan 24, 2017

@glittershark any comments?

@mohitgarg
Copy link

I am facing the same issue. Have you guys found any solution?

@thabti
Copy link

thabti commented Mar 7, 2018

Still facing similar issue :( with react-hot-loader 4

@thabti thabti linked a pull request Mar 8, 2018 that will close this issue
connorzg added a commit to connorzg/reactable that referenced this issue Jul 16, 2018
With this PR it no longer matters where the function lives in memory.

glittershark/reactable#338
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants