Skip to content
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

Form state only saved once #12

Open
alarinn opened this issue Sep 26, 2018 · 2 comments
Open

Form state only saved once #12

alarinn opened this issue Sep 26, 2018 · 2 comments

Comments

@alarinn
Copy link

alarinn commented Sep 26, 2018

I have this SPA that has a TabView (Primereact) where one tab sit s a Formik component, another eventually to display a DataTable, another with an iframe showing an app from another server, and then another tab for future content. At first, the form data would disappear when I changed tabs, but then I tried formik-persist and it works once. I can enter data on the form and then change tabs and come back and the data is still there. But, if I do nothing in the form and repeat the steps, the next time I come back to the form, everything has been reset. I tried looking at what you did in the persist code to see why the storage is treated like per request, but wasn't able to determine why the persisted data would reset. I'm under a tight deadline so moving on for now and come back to this later. I know at some point I might need to add Redux for persisting the datatables, but was hoping for a quick fix.

@alarinn
Copy link
Author

alarinn commented Sep 27, 2018

So without requirements, the screen changed again. So now I have my data table where I can select a record which routes me to my form with data populated. Now if I go back and select a new record, the old record is displayed. I have to go back and select the record again before it shows up in the form. I can see the new record in the MapPropsToValues. I had to remove for now.

@phuongthuan
Copy link

@alarinn same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants