-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Table is not refreshed with remote data #859
Comments
You can set up a ref for the table, such as tableRef = useRef() in the table props, you set the ref In other locations in your component, you can trigger a refresh by using the ref tableRef.current.onQueryChange(); Our remote data is set up like: data={query =>
} |
In other parts of the application I use onQueryChange without any problem. The problem comes when the asynchronous function is changed. For example, I have also tried:
Another test has been using effect. But the problem is that I have 2 calls to the api when the page is rendered for the first time.
|
Yrs i think the callback is only called if something is the query changes, not if the callback changes. This is dine because people to not memorize their functions and this would result in infinity loops. |
If I remember correctly, from an experiment I did some time ago, In the parens for onQueryChange(here), I THINK you can put in the updated data class. |
Description
When the data attribute is a function and this callback is changed, the data is not refreshed again.
Demo
https://codesandbox.io/s/material-table-starter-template-forked-cxqmwq?file=/src/index.js
Expected behavior
Make a remote call again
Additional context
I think the problem is in the componentDidUpdate method there is no else section
The text was updated successfully, but these errors were encountered: