GithubHelp home page GithubHelp logo

Comments (4)

vladra avatar vladra commented on July 16, 2024

And actually this approach doesn't work if I need to change form state outside of specific input field (for example load data to form on button click)

from form.

tannerlinsley avatar tannerlinsley commented on July 16, 2024

How does your form grow? Do you simply have a lot of inputs? Or do you have extremely deep objects as your values?

from form.

vladra avatar vladra commented on July 16, 2024

I have form which is built based on values it has, with ability to add new values. For example tariffs[0].name, tariffs[0].price. About 30-40 fields on average. 10-15 of them are multiselects, few text inputs and others are selects.

I've found the you provide access to formAPI via context, so this solved my problem for now. I still need to store input value somewhere (outside of form state), to be able to compare current formValue (accessible via context formAPI) with previous (stored inside of input component).

Don't think it's possible to speed it up without shouldComponentUpdate. Also if there was an easy way to access previous value (without storing it manually), that could be useful.

Anyway, if you have better approach, let me know :)

from form.

tannerlinsley avatar tannerlinsley commented on July 16, 2024

Yeah, optimizing for extremely large forms here would potentially touch all points of the library, so I think we need to ponder how we would accomplish this a bit more before we go diving in :)

Closing this issue for now since you were able to skirt around things with access to the internal state, but let's keep the discussion going as we find better ways to optimize things.

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.