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

React 18 asyncValidations doesn't work anymore #115

Open
hugo-lovighi opened this issue Apr 19, 2022 · 3 comments
Open

React 18 asyncValidations doesn't work anymore #115

hugo-lovighi opened this issue Apr 19, 2022 · 3 comments
Labels

Comments

@hugo-lovighi
Copy link

hugo-lovighi commented Apr 19, 2022

Hello !
I upgrade to react 18 and the asyncValidations rules doesn't not work anymore.

const { isValidating } = useField(props)

isValidating always return true

I try to find a solution working around react-18-upgrade-guide Promises but I dont really understand where the problem come from.

Thank you for your amazing lib !

@ivan-dalmet
Copy link
Member

Hi @kesm0
We are working on the library to make sure that it will work well with the new React 18.
For now, unfortunately, I don't have a quick fix.
If you can provide a codesandbox with the bug we can look at it more deeply.
Else we will focus on the news version for full React 18 compatibility 😊
Thanks for the feedback!

@hugo-lovighi
Copy link
Author

hugo-lovighi commented Apr 20, 2022

Hello @ivan-dalmet !

I figured out that was coming from react strict mode.
As mentionned in offical guide

Strict Mode has gotten stricter in React 18

Everything work as excpeted disabling it.

If anyone has the same problem, quick fix:

  • Removing <StrictMode>
    or
  • reactStrictMode: false (with nexjs, in nextjs.config)

@ivan-dalmet
Copy link
Member

Thanks a lot for the workaround! ❤️ ❤️❤️

@ivan-dalmet ivan-dalmet added the v1 label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants