v7 Feedback & Ideas
See original GitHub issueHi, First, I’m trying v7, it’s awesome to work with Hooks! Trying it for the first time so my comments might be wrong.
Describe the bug
This are more of an architecture comment than a bug:
If you disable useExpanded
hook, the table breaks.
I know in userland you can’t disable this hook but the fact that this happens, (edit: actually you can) probably demonstrates wrong app design: I figured out this is happening because you’re building initial state within the useExpanded
hook (row.cells = ...
).
Expected behavior I think that adding or removing hooks should not break the entire component. Hooks should be encapsulated.
Codesandbox! https://codesandbox.io/s/nk9rmym6m4
Solution
That initial state logic could be within useTable
itself (tested and works fine).
I can provide a PR if needed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:101 (33 by maintainers)
I’m writing the documentation right now. It’s a big undertaking so be patient. It’s gonna be great. On Jul 17, 2019, 6:21 AM -0600, Aurimas notifications@github.com, wrote:
@tannerlinsley would you be able to publish the new version with the latest code, please?