Comments (5)
Additional context: it happens after calling form.setFieldValue directly after useForm
watch(deps, () => {
form.setFieldValue('name', 'john doe')
})
but if i do this, it work
watch(deps, () => {
nextTick(() => {
form.setFieldValue('name', 'john doe')
}
})
however calling setFieldValue with { dontUpdateMeta: true } prevent the bug from happening
watch(deps, () => {
form.setFieldValue('name', 'john doe', { dontUpdateMeta: true })
})
from form.
Changes relative to this had been added by this commit: 4e4a3ae
(poke @crutchcorn)
from form.
I'll leave there the details of my debugging for context purpose,
my final fixes was to remove the snippet mentioned above
const store = form.useStore();
Object.entries(store.value.values).forEach(([key, value]) => {
form.setFieldMeta(key, (prev) => ({
errorMap: {},
...prev,
}));
})
and always call setFieldValue with opts: { dontUpdateMeta: true }
(which is not documented and not mentioned in the releases notes)
from form.
If you are using dontUpdateMeta
you are almost 1000000% doing something wrong. There is a good reason it is not documented.
Please follow the issue template and provide a minimal reproduction, otherwise there's nothing we can do to help.
from form.
Related Issues (20)
- [Tracking] The Road to 1.x
- ReactFormApi typing not exposed HOT 5
- Dependency Dashboard
- TypeError on validatorAdapter when passing form schema generic to useForm HOT 3
- form submit not trigger validators.onChangeAsync HOT 1
- Unable to display Validation Messages with Zod in Next.js HOT 4
- Zod field errors not populating for individual fields on form level validation HOT 7
- type error when using yup object schema fields HOT 1
- Array setFieldValue not behaving as expected.
- Type instantiation is excessively deep and possibly infinite on form.filed when using supabase generated types HOT 1
- `form.update` overwrites options instead of merging HOT 1
- ts error with useField: Type instantiation is excessively deep and possibly infinite HOT 3
- There is no easy or documented way to use `<button type="submit" name="...">` HOT 1
- "Type instantiation is excessively deep and possibly infinite" and tsc crashing HOT 6
- Image in README mistakenly mentions Svelte support HOT 1
- Data is not sent to the server (using Server Actions) if the input is disabled (disabled=true) HOT 1
- Accessing form error array using form.useStore and destructuring can cause react update depth issue
- Using both `onMount` and `onChange` validators on a field doesn't work HOT 4
- state.canSubmit value flickering with async validation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form.