React Native multiple forms per item

Viewed 19

Sorry for my bad english, it's not my native languaje...

I have a screen where I print vehicles as they would look like in real life. The point is that each vehicle is a form, where each vehicle can have a certain amount of items, these items are like mini forms inside the vehicle (there can be maximum 4 vehicles per screen). Also depending on what the user puts in these mini forms, it is represented in the vehicle that I already printed.

The problem is that to print these vehicles I receive certain information with a specific format (I must organize the API information to have a more faithful representation of real life). Which is different from the format that the forms must have, also because it is not mandatory to fill in all the parameters of the form.

Which generates a conflict with the component because in it (which I am printing from the information I receive and transform) I also have to represent in real time what the user fills in these forms.

I tried to use the Context API and a reducer but these caused me problems with the renderings, I lost the information that the user wrote in the form, apart from the fact that I have to go through the list of vehicles, then the list of items to be able to find the one that the I edit user, but it had two states, one where I had the information that I printed, and another that was as such the form that I am going to send.

Sorry if it wasn't very clear, I'm happy to answer your questions and thanks for trying to help me (I'm a react jr developer on my first react native app)

0 Answers
Related