-
-
Notifications
You must be signed in to change notification settings - Fork 493
TableBody component should respect isLoading state and not attempt to render empty state fallback during initial loading #1368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
any workaround on that? |
material-react-table/packages/material-react-table/src/hooks/useMRT_TableInstance.ts Lines 222 to 249 in 8293b96
Here the logic shows statefulTableOptions.state.isLoading ||
statefulTableOptions.state.showSkeletons While it seems to me that it should be |
@meesvandongen I agree |
I am no maintainer so I have no influence here whatsoever. Though I imagine @KevinVandy would be happy to merge it. |
material-react-table version
v3.1.0
react & react-dom versions
v18.2.0
Describe the bug and the steps to reproduce it
When isLoading is true, the table still attempts to access and render data properties, which can cause type errors. The table should not try to access or render any data during the initial loading state, and should only show the loading overlay.
Currently, the MRT_TableBody component only checks for empty rows (!rows.length) but doesn't consider the isLoading state. This causes two issues:
Type errors when accessing data properties during loading
Unwanted empty state fallback being rendered behind the loading overlay
Steps to reproduce
Expected behavior
The MRT_TableBody component should check for isLoading state before attempting to render or process any data.
Minimal, Reproducible Example - (Optional, but Recommended)
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Yes, I think I know how to fix it and will discuss it in the comments of this issue
Terms
The text was updated successfully, but these errors were encountered: