Giter Club home page Giter Club logo

Comments (5)

yotov avatar yotov commented on May 10, 2024 2

I have a related question. Is there an option to pass current values when the form is rendered for the first time.

Here is an example what use case I want to implement.
I'm fetching a resource from backend to edit and show a form where initialValues are populate from this resource. Then change some fields and destroy the form ( e.g. I can have two tabs and just switch to the next tab and come back later ). The form current values were persisted on componentWillUnmount to some external store ( e.g. localStorage, redux or something else ). Then come back to the form and now I want to set initialValues and currentValues.

One options is to set currentValues as initialValues, but I will lose pristine and dirty flags. Is there some option to change all current values?

from react-final-form.

erikras avatar erikras commented on May 10, 2024

Final Form manages its own state. You put state in, with initialValues, and you get state out, with onSubmit, and your global app state management solution (GASMS?) need not worry about the state of the form. However, if you want to, you can totally plug update your GASMS with state from Final Form.

I don't really understand your question, so I cannot be certain that I have answered it. ?

from react-final-form.

a-x- avatar a-x- commented on May 10, 2024

Ok, I understand you. I’ll think how applicable that approach for our use-cases. Thank you.

from react-final-form.

erikras avatar erikras commented on May 10, 2024

👍 Closing, then.

from react-final-form.

lock avatar lock commented on May 10, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from react-final-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.