issue: formState is not updating when the fields onChange #8179
-
Version Number^7.28.1 Codesandbox/Expo snackhttps://snack.expo.dev/@galih56/react-hook-form-login-page Steps to reproduceFill up the fields. Expected behaviourformState values must be updated What browsers are you seeing the problem on?No response Relevant log outputLOG {} Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Answered by
bluebill1049
Apr 13, 2022
Replies: 1 comment 5 replies
-
please kindly send sometimes with the doc before posting an issue. https://react-hook-form.com/api/useform/formstate // errors is coming form formState,
const { register, handleSubmit, errors, getValues, setError,setValue,
clearErrors, formState, reset, control } = useForm({
defaultValues: {
email: '[email protected]',
password: 'secret'
}
}); Follow the example in this section: <Controller
name="email"
rules={{ required: {value:true,message:"Email harus diisi" }}}
control={control}
render={props => <Input
label='Username/email : ' name="email" autoCapitalize="none"
error={!!email.error}
errorText={email.error} style={styles.input}
{...props} // you should not spread the entire props instead assign props according
/>}
/> |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
galih56
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
please kindly send sometimes with the doc before posting an issue.
https://react-hook-form.com/api/useform/formstate
Follow the example in this section:
https://react-hook-form.com/get-started#ReactNative