App remounting on language change #1796
-
Hello, In our application we have several pages with forms. We use react-final-form to manage the forms. It keeps some state internally - the values in the fields, whether or not they are valid, touched etc. I believe this is achieved through react context and providers. However, if the user changes the language, the whole app is unmounted and remounted, causing all state to be lost. Not just the state in react-final-form, but also any other react state set inside the pages. As discussed here #1769 (comment) this is intentional. In theory, we could wrap appWithTranslation in another HOC and keep our state there, and then pass it down to our forms. However, this is quite inconvenient. So my question is why is this remounting necessary and is there a way to avoid it? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please see my answer here: |
Beta Was this translation helpful? Give feedback.
Please see my answer here:
#1769 (comment)