What is the proper way to update store value based on props or state? #1957
-
I'm using MST with React and read React new beta docs: You Might Not Need an Effect. In the docs, it says that updating state based on state or props is bad idea. In this perspective, updating MST store value based on props or state with Thanks for your reading :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @baeharam! If you want to update a MST store value based on props or state changes it might be worth taking a step back and evalute how you are interacting with your data. Do you have an example where you would like to update a MST store based on prop or state changes? A |
Beta Was this translation helpful? Give feedback.
Hi @baeharam!
If you want to update a MST store value based on props or state changes it might be worth taking a step back and evalute how you are interacting with your data. Do you have an example where you would like to update a MST store based on prop or state changes?
A
useEffect
can be a nice way to sync prop changes into local component MobX state, but that's another problem entirely.