Git Product home page Git Product logo

Comments (5)

SergiuPlesco avatar SergiuPlesco commented on May 30, 2024 2

There are typescript errors as well.
ex. index, field state value is undefined and these come from typescript definitions...

from form.

crutchcorn avatar crutchcorn commented on May 30, 2024 1

Oh! This is an immutability issue, then! 😅 Reopening and tagging @aadito123 who's working on array stuff now

from form.

crutchcorn avatar crutchcorn commented on May 30, 2024

@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.

crutchcorn avatar crutchcorn commented on May 30, 2024

@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.

rodogir avatar rodogir commented on May 30, 2024

@crutchcorn

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.