-
-
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
[BC Break] Cleanup dataProvider code #7001
Conversation
eefbd3e
to
df981ee
Compare
- useQuery - useQueryWithCache - useMutation - Query - Mutation - dataProviderProxy
The PR is now Ready for Review |
const BanUserButton = ({ userId }) => { | ||
- const { loaded, error, data } = useMutation({ | ||
- type: 'banUser', | ||
- payload: userId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- payload: userId | |
- payload: { id: userId } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, and nto the purpose of this snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove / Update references to removed actions:
* @example Action customization |
* and therefore we need a custom action (CRUD_GET_LIST) that will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment as mutation callbacks can no longer be used as event handlers:
- return <button disabled={isLoading} onClick={updateMany}>Reset views</button>;
+ return <button disabled={isLoading} onClick={() => updateMany()}>Reset views</button>;
* return <button disabled={isLoading} onClick={updateMany}>Reset views</button>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
- For instance, here is how to override the side eggects for the `getOne` query in a `<Show>` component:
+ For instance, here is how to override the side effects for the `getOne` query in a `<Show>` component:
Line 543 in 0de1637
For instance, here is how to override the side eggects for the `getOne` query in a `<Show>` component: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still valid to pass an onSuccess
side effect like in this comment ?
* May include side effects to be executed upon success or failure, e.g. { onSuccess: { refresh: true } }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove useVersion
hook from Reference.md
line 212
- * `useVersion`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit's successMessage
is still referenced in some files and should be removed:
docs/CreateEdit.md
packages/ra-core/src/controller/edit/useEditContext.tsx
packages/ra-ui-materialui/src/detail/Edit.tsx
packages/ra-ui-materialui/src/detail/EditView.tsx
Review applied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There an eslint warning left but otherwise, this is great!
We no longer need to rely on Redux for the data fetching.
useQuery
,useQueryWithStore
,useMutation
)<Query>
,<Mutation>
)