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

value is not showing when using with react hook form #141

Open
dtsuper3 opened this issue May 4, 2023 · 0 comments
Open

value is not showing when using with react hook form #141

dtsuper3 opened this issue May 4, 2023 · 0 comments

Comments

@dtsuper3
Copy link

dtsuper3 commented May 4, 2023

I am using it with react hook form. I have created a wrapper component using the react-hook-form controller. So the issue here is the value property not updating the UI but it is reflecting in props. I think some issues related to component re-rendering.
<Controller
control={control}
name={name}
render={({field: {value, onChange, onBlur}, fieldState: {error}}) => {
console.log('value:', value);
return (

<PhoneInput
textInputProps={{
onFocus: () => setIsFocus(true),
onBlur: () => {
onBlur();
setIsFocus(false);
},
}}
value={value}

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

1 participant