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

Setting State inside onChage does not work. #7

Closed
or-orsatti opened this issue Mar 31, 2019 · 1 comment
Closed

Setting State inside onChage does not work. #7

or-orsatti opened this issue Mar 31, 2019 · 1 comment

Comments

@or-orsatti
Copy link

or-orsatti commented Mar 31, 2019

i can't set state inside the onChange. i have seen this error accured already, but yet no solution found.

phoneInput: (value, country) => { const phoneNum = value; console.log(phoneNum, country); setUser({ ...user, Phone: value }); },
this is the code for the onChange.
the result of this is not error, but a rather weird behavior; the input will not show the number, and in the state it'll update 1 number top ("+9721")

@alexplumb
Copy link
Owner

Thanks for the example - this should be fixed now! :)

david-vendel referenced this issue in david-vendel/material-ui-phone-number-2 May 18, 2022
…ow-redirects-1.14.9

Bump follow-redirects from 1.14.4 to 1.14.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants