New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Reuse field states from already created instance #474
Comments
The use case does make sense, I have a feeling it is achievable already at this stage - have a look at wizards? If you can create a mock-up sandbox of a case where conditional rendering fails and discards the data we can have a look at it. |
Thank you and sorry for the late response. I will make the mock-up and come back again. |
Greetings @gertdreyer, https://stackblitz.com/edit/stackblitz-starters-vm3r9h?file=src%2FApp.tsx Thanks again! |
I have not debugged this behaviour properly but I feel it may be related to the code below when the field is not rendered anymore and touched becomes undefined. I would be willing to accept a PR for a new prop that enables the retaining of the meta state as long as it does not change the current default behaviour. |
Hey @gertdreyer, any advice on this feature? |
Greetings,
Good to see that this project is still active.
Currently one can use
createForm
instance for the form, and then supply it to React withform={formDate}
.The issue is when fields
unsibscribe
, the form erases theirFieldState
. E.g. touched, valid, etc. However not always that is the right solution, especially with big forms, trying to hide parts of the form as optimization.My wish is to add and option to each field, so FF can persist their
FieldState
onunsubscribe
, and use it again when the same fieldsubscribe
.I am willing to provide PRs, if my request makes sense to project owners.
Best,
Dragomir
The text was updated successfully, but these errors were encountered: