Replies: 8 comments
-
|
Beta Was this translation helpful? Give feedback.
-
In the example I gave, how do I link the data on the first page to the data on the second page? |
Beta Was this translation helpful? Give feedback.
-
You can host your data in a local/global state as I suggested above. you can watch this quick tutorial as well: https://www.youtube.com/watch?v=CeAkxVwsyMU |
Beta Was this translation helpful? Give feedback.
-
Yes, I do. This is exactly what I do in my codSanbox example. But there is a problem when trying to pass initial values to the second page. In my example, the data on the second page depends on the data on the first page. |
Beta Was this translation helpful? Give feedback.
-
The example in the video is clear and simple. |
Beta Was this translation helpful? Give feedback.
-
I don't see difference tho, you can host your data in a global store which connected two pages and if your initial data come async you can use |
Beta Was this translation helpful? Give feedback.
-
The difference is that when the object has unrelated data. We can easily margim of using:
But if you look closely at what is happening in the example, you will understand that not everything is so simple. |
Beta Was this translation helpful? Give feedback.
-
I understand everything is not simple and what's why I build this lib to make the thing easier, so back to the square one: what's the issue with the API which lead to your problem? I don't have time to analyze each users' implementation, as I suggested above what are the steps to reproduce the problem. |
Beta Was this translation helpful? Give feedback.
-
I implemented the wizard form in 2 steps.
At the first step, sections are created.
In the second step, sub sections are added to these sections.
I tried to combine the state of the first page and the second and got a lot of problems:
To solve the problem, userform must accept intiailValues with id and other unused fields. The same data must be sent to submit.
https://codesandbox.io/s/react-hook-form-errormessage-uikjg?file=/src/index.js
Beta Was this translation helpful? Give feedback.
All reactions