You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this issue!
For now, there isn't really a way to have centralized state.
You can share states from parents to children (~/examples/nested_store.rs), but there isn't really a way to have everything centralized.
Tho you could do something like:
As someone who uses Mobx, I usually don't use (Reacts) context at all outside of theme.
Mostly because it hides the contract between the component and what it needs.
By making sure that things are passed in as props, you know exactly what comes in and what is expected to render a component. You'll find quickly that it isn't as bad as you think it is.
One key ingredient is, that nested data always have a way to get back to the root Application store.
e.g AppStore -> TodoStore -> Todo
Todo has a weak reference to its store TodoStore which in return has a weak reference to AppStore.
The only time I've ever used context is for accessing theme data. But the component can run without a theme, so it doesn't matter. But it can't run without the state it needs, which is why it's important to have it as a prop.
Can i use modx алк shared state pattern? Without set parameters from parent to child component? Like use_context_provider provider?
The text was updated successfully, but these errors were encountered: