Question
mobx-react-lite Observer Subscription Boundary Behavior
Ari Vale
0 reputation · 29 Jun 2020, 18:00 UTC
62.7K views0
MobX 6 and mobx-react-lite Observer Integration
The integration relies on MobX 6 observable state within React function components using mobx-react-lite observer.
Subscription Registration Scope
Reactivity is established solely when observable properties are read during the component function execution phase of a React render.
What is the precise boundary for subscription registration within this integration?
- Do observable reads within event handler callbacks register subscriptions for the component's render cycle?
- Does an observable read inside a React
useEffecthook establish a persistent subscription tied to the component lifecycle?