Replies: 2 comments 6 replies
-
Please create a small reproduction of what you are trying to do in codesandbox.io
…On Mon, Feb 1, 2021, 11:40 AM Rupert Schaffarz ***@***.***> wrote:
Hello
I have a simple react application with two pages. I am storing the
selection state ('clicked') in a global mobx store.
page 1 1) select buttons on page one
2) click 'NEXT' button
page 2 3) display button state of page 1 buttons ('clicked/un-clicked')
4) click 'BACK' button
page 1 5) modify button state
when returning to page 1 in 5) the state of all buttons is lost. How can I
use mobx to restore the button state ?
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2772>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCW4XFSTJQJDD4KPWYOS3S43RP7ANCNFSM4W5GCBKA>
.
|
Beta Was this translation helpful? Give feedback.
4 replies
-
If you want help, we indeed need to see the runnable code. However, note that MobX itself has no mechanism built-in for persisting and restoring state. It's completely up to you how you approach it. Alternatively, there are more robust solutions like mobx-state-tree or mobx-keystone that makes persistence easier. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I have a simple react application with two pages. I am storing the selection state ('clicked') in a global mobx store.
page 1 1) select buttons on page one
2) click 'NEXT' button
page 2 3) display button state of page 1 buttons ('clicked/un-clicked')
4) click 'BACK' button
page 1 5) modify button state
when returning to page 1 in 5) the state of all buttons is lost. How can I use mobx to restore the button state ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions