-
-
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
restore deprecated undoable prop original behavior #6153
Conversation
import PropTypes from 'prop-types'; | ||
import { Record, RedirectionSideEffect, MutationMode } from 'ra-core'; | ||
|
||
import { ButtonProps } from './Button'; | ||
import DeleteWithUndoButton from './DeleteWithUndoButton'; | ||
import DeleteWithConfirmButton from './DeleteWithConfirmButton'; | ||
|
||
const useMutationMode = (mutationMode, undoable) => { |
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.
Can you extract this in a dedicated file ?
import PropTypes from 'prop-types'; | ||
import { Record, RedirectionSideEffect, MutationMode } from 'ra-core'; | ||
|
||
import { ButtonProps } from './Button'; | ||
import DeleteWithUndoButton from './DeleteWithUndoButton'; | ||
import DeleteWithConfirmButton from './DeleteWithConfirmButton'; | ||
|
||
const useMutationMode = (mutationMode, undoable) => { | ||
useEffect(() => { |
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.
I'm -1 with this useEffect and the related warnings. A simple function, rather than a hook, will be enough.
bump, could you please apply the review? |
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 is a linter warning about performances
1a589bf
to
9028481
Compare
For retrocompatibility undoable=false should be on pessimistic mode, currently it is on undoable mode.