The issue involves React internals and MobX integration, requiring careful handling of side effects.
The issue reports that React 19.2's component performance tracking causes side effects (warnings) when used with MobX due to deep property comparisons outside MobX reactions. The solution requires either disabling performance tracking or modifying how properties are enumerated, but the exact implementation details and potential performance impacts are not fully clear.
React version: 19.2.x
See https://github.com/mobxjs/mobx/issues/4607
The new component performance track causes side-effects (warnings) with mobx since the component performance tracks does a (deep) comparison of component properties. This happens outside of a mobx reaction which causes the warning.
Link to code example: React 19.2.3 (warnings): https://codesandbox.io/p/sandbox/component-performace-tracks-mobx-warnings-c8wkwy React 19.1.4 (no warnings): https://codesandbox.io/p/sandbox/component-performace-tracks-no-warnings-ttx7gt
Warnings logged since keys & values of component properties are enumerated in performance tracks, e.g.:
[mobx] Observable 'someProp' being read outside a reactive context.
No side effects -> no warnings.
Possible options: Option 1: A way to disable component performance tracks Option 2: No deep enumeration of property keys and values?
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!