Comments (5)
There are typescript errors as well.
ex. index, field state value is undefined and these come from typescript definitions...
from form.
Oh! This is an immutability issue, then! 😅 Reopening and tagging @aadito123 who's working on array stuff now
from form.
@SergiuPlesco TypeScript errors should be reported elsewhere, but there have been a ton of typing fixes since this was opened, so the issues you experienced may have been solved
from form.
@rodogir the more I think about this, the more I'm not sure how we could solve this in any meaningful way. From our perspective we shouldn't keep track of an internal key but your data should. We could introduce some kind of keyExtractor
or something but even then what would that solve over key={yourIdHere}
in React?
I think I'm going to close this for a triage of the upcoming 1.x release, but that doesn't mean the conversation is over. Please keep chatting about the topic and you might convince me that we need to reopen it :)
from form.
The example in the original issue already tries to solve it by managing the key outside the library. See the hobbies
fields. In the discord thread I mentioned a potential bug:
I tried adding stable key handling outside of the form to solve it, but it does not work. This is because
hobbiesField.state.value
only changes on array size changes, not on reordering.
My guess: if hobbiesField.state.value
changed on reordering it would solve the problem.
IMO there is no need for the library to keep track of an internal key as long as a solution exists. Currently, the behavior I mentioned is preventing me from handling stable keys.
from form.
Related Issues (20)
- Calling `createFormFactory<FormData>` and using a validator adapter throw TS errors HOT 1
- onChangeAsyncDebounceMs not properly debouncing HOT 1
- TanStack/Angular - Error when resetting the form HOT 1
- Missing error when validating via form options instead of via field HOT 3
- Factory `onSubmit` function not invoked whenever factory.useForm gets provided with `onSubmit` itself HOT 2
- Unable to read properties in nested array table HOT 2
- Nested Values Disappear when using StrictMode HOT 5
- onMount Error is not revalidated when the user changes the input HOT 2
- server actions example errors when using zod adapter HOT 1
- Cannot infer types on arrays of union of objects HOT 2
- Moving subfields of array field mix their values HOT 1
- Bad performance with 100+ rows in an array field HOT 4
- insertFieldValue replaces item instead of adding a new one and shift existing items
- solid form createField failed to import `memo` from "solid-js/web" when used in solid-start ssr mode HOT 1
- Issue with array + react + numbers HOT 2
- Nested Values Disappear when using StrictMode and `pushValue` HOT 2
- Incorrect field.state.value type HOT 5
- Server Actions example leaks backend code HOT 1
- Example for array usage lacks mode="array" HOT 1
- `canSubmit` is always `true` on first render of form 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.