-
-
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
onSubmit not available, can't use server-side validation and <Confirmation /> together #7924
Comments
Thanks for your report. |
Update For now I'm using 2 However, using this solution makes the server-side validation working, but breaks the default behaviors like showing a successful message and redirect to the list page. I guess the best solution would be point number 3 or having access to Original There's 3 ways I'm seeing to solve this but none of them seems the best way
Or, But the better way would be a simple solution when mixing |
Maybe this resent PR #8199 could help you when the next react-admin version gets released. See react-hook-form/react-hook-form#5494 (comment) Plus, maybe we should document this a little bit better also. |
@newfylox Did you find a better way? |
@jashwant unfortunately no, I did work on my project since a couple of week... but soon I'll have to come back to update code and I'll try to see if I can better refactor it. |
Coming back to this issue while doing some triage. To me, this is something react-admin does not (yet?) support, but this is not a bug. |
When using
react-admin
V3, we had a hook on thehandleSubmit
. Now that it's removed in V4, I can't figure how to use server-side validation and<Confirmation />
component together. Should youronSubmit
be available to use?Because Server-side validation needs to give a "save" function to
SimpleForm
usingonSubmit
. But When using<Confirmation />
, there's no way from there to use youronSubmit
implementation to call it if the user confirms the prompt.So mixing both seems impossible.
The text was updated successfully, but these errors were encountered: