jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.73k stars 2.77k forks source link

[Feature request] add replace/reset field value #3838

Open bluelovers opened 1 year ago

bluelovers commented 1 year ago

Feature request

Current Behavior

{
fieldA: {
p1: 1,
p2: 2,
}
}

when setFieldValue('fieldA', {})

the value of fieldA is still

{
p1: 1,
p2: 2,
}

Desired Behavior

replaceFieldValue('fieldA', {}) => fieldA is {} resetFieldValue('fieldA') => fieldA is init value

Suggested Solution

Who does this impact? Who is this for?

Describe alternatives you've considered

Additional context