Hacker News new | ask | show | jobs
by eropple 2612 days ago
IMO, context does a lot to remove the value of MobX from React applications. Not necessarily Redux; Redux gives you some additional stuff, particularly around state tracking and rewinding. But I haven't seen a MobX project where a judiciously used context doesn't solve the same problem within the React-specific ecosystem.
1 comments

The value of mobx is that you implicitly link each component to its data dependencies by dereferencing arbitrary paths into your storage objects in the render() function so that the component rerenders only when data at those paths change.

Does the Context achieve this as well? From a quick search, the Context seems to force rerender of any consumer on any change.

You can use library like reselect to optimize. The job of context is simple: implicitly passing down value to deep component.