dimanche 19 avril 2015

Preserve Input Values when switching between views in React

Situation: I have a several input components but depending on the route (react-router) different ones are shown.


Problem: I want the input values the user already entered to be preserved when switching back and forth between routes and dropping/re-adding input components.


I came up with two solutions so far: 1) Always render everything but hide via CSS if not to be shown (breaks the idea of React for me somehow) 2) Implement some kind of "input value store" in the flux architecture (pretty elabortate)


Any other ideas? Am I missing something more fundamental?


Aucun commentaire:

Enregistrer un commentaire