-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
useQuery returns error after optimistic save #6751
Comments
Can you elaborate on your usecase? What are you trying to achieve? I tried the code you put in the demo without having any issue. And please, follow the issue template |
I've updated my issue to follow the issue template. I tried to reproduce this in the CodeSandbox at https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple but I keep getting this error when it tries to compile: ERROR in ./src/polyfills.ts I am able to reproduce the issue by running the demo from the repo locally. The error is visible in the browser devtools console. |
also experienced this issue.
Error happens here on line 134 I believe the variable Also, the issue only happens after the save. If you refresh the page, either through |
I made a codesandbox fork here: https://codesandbox.io/s/keen-snowflake-tmftd The changes I made are in src/posts/PostEdit.tsx To reproduce the error:
|
any progress on this issue? |
same issue, but i used dataProviderProxy from usecase: my api entity has multiple relationships and complex formatting logic on userside. I need to fetch some data (in my List or Datagrid component) for processing this in another example in codesandbox: https://codesandbox.io/s/usedataprovider-example-jb68p-jb68p
some notes: workaround:
|
Reproduced, thanks for the codesandbox. |
Hi! Just wanted to check in on this. Is it fixed as part of v4? If not, any plan on addressing it soon? |
We no longer export a |
With the release of react-admin v5, react-admin v3 has reached its end of life. We won't fix bugs or make any new release on the 3.x branch. We recommend that you switch to a more recent version of react-admin. So I'm closing this issue as we won't fix it. |
What you were expecting:
Fetch data with useQuery from inside Edit/Create components and correctly receive data.
What happened instead:
useQuery returns an error after save:
error TypeError: Cannot read properties of undefined (reading 'data')
.Steps to reproduce:
I am trying to fetch data with useQuery from inside Edit/Create components. I have
redirect={false}
on the SaveButton so the form stays visible.If
mutationMode={"undoable"}
, useQuery returns an error after save:error TypeError: Cannot read properties of undefined (reading 'data')
.Related code:
I tried to reproduce this in the CodeSandbox at https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple but I keep getting this error when it tries to compile:
I have reproduced this behavior in the react-admin demo app (pulled the repo and ran the demo locally) by changing
src/reviews/ReviewEditToolbar.tsx
like so:The text was updated successfully, but these errors were encountered: