Want value of form which doesn't change. #10054
Unanswered
shivamfinzome
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
const [preChangeValue, setPreChangeValue] = useState()
useEffect(() => {
setPreChangeValue(getValues(`fields[idx]))
}, [])
const handleCancel = () => {
setValue(fields[idx], preChangeValue)
}
but the handleCancel always have new value of form.
Beta Was this translation helpful? Give feedback.
All reactions