isLoading doesn't work properly
Describe the bug If you use the isLoading prop in conjunction with data, the table crashes and says the data can't be null
To Reproduce Steps to reproduce the behavior:
- Make a table with
data={tableDataVar} - Set the isLoading prop to
isLoading={!tableDataVar} - An error appears saying that data must not be null
Expected behavior The error should not appear if the isLoading value is set to true
Set your state’s data prop to an empty array. You have a table in your UI expecting it to have data at some point in the form of an array, if the array is empty material-table shows your users a nice no data message which you can also override with localization. For state expecting an array of values generally I have seen you set it to an empty array with initialState.
Hi @jakeleventhal ,
This is not a bug. You should set a empty array to data. If you want to loading animation you can use data.length === 0 or use another flag on state.