I'm using promise to fetch material-table's pagination, instead of using an complete array.
It's something like that:
<MaterialTable
title="Users"
icons={tableIcons}
columns={columns}
data={
new Promise((resolve, reject) => ... )
.then(...)
.catch(err => {
console.log(err);
reject(err);
})
detailPanel={DetailPanel}
/>
So far, so good, everything is fine.
Now I'm forcing errors, like shutting down the backend while changing the page, or messing with the query response.
But, when it catches the error, it doesn't render anything about the error, it just keeps with the circular progress animation. Does material-table have any hook for this kind of error?
Hello,
i think you need to throw the error first.
```
data={
new Promise((resolve, reject) => ... )
.then(response => {
if(response.ok) return response.json() else throw response;
})
.catch(err => {
resolve({data: []}); //etc
})
Most helpful comment
Hello,
i think you need to throw the error first.
```
data={
new Promise((resolve, reject) => ... )
.then(response => {
if(response.ok) return response.json() else throw response;
})
.catch(err => {
resolve({data: []}); //etc
})