-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Bug: useField can not get newest value #984
Comments
Experiencing same issue. Bump. |
@makap0120 Just like in demo, we are using |
Thanks for quick reply :) Oh i see, this doesn't seem as optimal solution in my case - to display field value i'm using I wonder why field subscribers miss this exact field change value change performed in useEffect during initial render.. |
This same bug applies to
It does this to avoid a double render, but it assumes that the state cannot change between the initial render and the effect phase, which as your use case illustrates, is incorrect. The effect phase runs depth-first, so any number of effect hooks can change the form state between the initializer and the permanent subscription. In your example specifically, the effect hook in the (I was looking into it because I was using a |
@makap0120 Recently I am trying create a custom hook to reactive some (not all) values of final form by use of |
Hi, I think I have experienced the same issue but in a different case: with conditional fields. https://codesandbox.io/s/react-final-form-conditional-fields-forked-pllcsp?file=/src/index.js I don't think I can use the |
@xxleyi @makap0120 @wilysword @iamdey
|
When I change form value in useEffect without event trigger or network delay, useField can not get the newest value.
Demo link is here: https://codesandbox.io/s/react-final-form-usefield-can-not-get-newest-value-gc3do4?file=/index.js
The text was updated successfully, but these errors were encountered: