-
Notifications
You must be signed in to change notification settings - Fork 125
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
setState changed value doesn't reflect on component #201
Comments
Very interesting. I'm not as familiar with formsy state as some other devs on the project. Why are you calling state at all instead of |
I was using |
If setValue isn't working that seems like a more core issue, and should give us a clue. Which version of Formsy are you running? And is there anything interesting or unique about your codebase? Ideally, we could see a minimal example of the bug in a public repo. Maybe you could clone the project and remove most of the code until you have a minimal example? |
I don't see any issue with what you have posted. The next render of your component will get the latest value when calling getValue(); (It's just a function that give you "this.state.value" (https:/formsy/formsy-react/blob/master/src/Wrapper.ts#L212) |
Hi I have the following console.log to see form component state changes:
And the output is:
Problem is that the component doesn't reflect the value change.
I also tried to print the state in
render
function withinwithformsy
, but the state is different:{isValid: false, isSubmitting: false, canChange: true}
It seems to me they are updating different component states?
The text was updated successfully, but these errors were encountered: