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

onChange returns old value if used with value prop #197

Closed
hornetDC opened this issue Sep 22, 2020 · 5 comments · Fixed by #198 or #199
Closed

onChange returns old value if used with value prop #197

hornetDC opened this issue Sep 22, 2020 · 5 comments · Fixed by #198 or #199

Comments

@hornetDC
Copy link

hornetDC commented Sep 22, 2020

Description

Title. It worked before in 1.0.8.

CodeSandbox

https://codesandbox.io/s/goofy-raman-znv2t

@stonebk
Copy link
Contributor

stonebk commented Sep 22, 2020

Looks like a regression from 904e927 -- looking into it.

@stonebk
Copy link
Contributor

stonebk commented Sep 22, 2020

It looks like getDerivedStateFromProps is removing our state change before onChange is called with the new value.

@stonebk
Copy link
Contributor

stonebk commented Sep 22, 2020

The PR needs some more thought -- going to revert the commit for now until the PR can get some more time.

stonebk pushed a commit that referenced this issue Sep 22, 2020
…avor of getDerivedStateFromProps" to fix controlled components

This reverts commit 904e927.

Fixes #197
stonebk pushed a commit that referenced this issue Sep 22, 2020
…avor of getDerivedStateFromProps" to fix controlled components

This reverts commit 904e927.

Fixes #197
@stonebk
Copy link
Contributor

stonebk commented Sep 22, 2020

[email protected]

stonebk pushed a commit that referenced this issue Nov 3, 2020
stonebk pushed a commit that referenced this issue Nov 3, 2020
@stonebk
Copy link
Contributor

stonebk commented Nov 3, 2020

[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants