Skip to content

What is the proper way to update store value based on props or state? #1957

Answered by EmilTholin
baeharam asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@baeharam
Comment options

@EmilTholin
Comment options

@baeharam
Comment options

Answer selected by baeharam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants