Skip to content
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

[Doc] Improve server side validation example #8378

Merged
merged 4 commits into from
Nov 10, 2022
Merged

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Nov 9, 2022

Related to #7608

I've tried it on simple project's UserCreate component, and it works as expected

@fzaninotto
Copy link
Member

I'm sorry, I don't see the difference between before and after. Can you keep the callback async to show the actual difference?

@WiXSL
Copy link
Contributor Author

WiXSL commented Nov 9, 2022

I'm sorry, I don't see the difference between before and after. Can you keep the callback async to show the actual difference?

I'm returning the promise and running side effects on success because of returnPromise: #7608 (comment)

That was the issue reported, the lack of redirection following the example as it was previously proposed

@WiXSL
Copy link
Contributor Author

WiXSL commented Nov 9, 2022

Mmm, trying it again, the warnWhenUnsavedChanges problem still remains.
I've reverted to the previous version of the example + Side Effects

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the dependency array of the useCallback is missing notify and redirect.

Lastly, I think #7608 is mainly about the warnWhenUnsavedChanges problem.
This PR is a welcome improvement but it should not close #7608 IMO.

docs/Validation.md Outdated Show resolved Hide resolved
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
@slax57 slax57 changed the title [Doc] Fix server side validation example [Doc] Improve server side validation example Nov 10, 2022
@WiXSL WiXSL merged commit 4ad05e6 into master Nov 10, 2022
@WiXSL WiXSL deleted the fix-ss-validation branch November 10, 2022 13:49
@WiXSL WiXSL added this to the 4.5.2 milestone Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants