Intended outcome:
Use React 19.2.x with mobx in development mode and observableRequiresReaction=true without being spammed by following warnings:
[mobx] Observable 'someProp' being read outside a reactive context.
Actual outcome:
With React 19.2.0, new performance tracks were introduced that show changed props for components:
https://react.dev/reference/dev-tools/react-performance-tracks#changed-props
If observable objects are passed into components, these performance tracks cause warnings if the observableRequiresReaction is enabled:
[mobx] Observable 'someProp' being read outside a reactive context.
How to reproduce the issue:
See the following minimal reproduction sandbox:
https://codesandbox.io/p/sandbox/component-performace-tracks-mobx-warnings-c8wkwy
- open the sandbox
- open the dev tools console
- click the "Next item" button
-> see warnings logged in the console
Does not happen with same sandbox when using React 19.1.4:
https://codesandbox.io/p/sandbox/component-performace-tracks-no-warnings-ttx7gt
Versions
react 19.2.0 and higher
mobx 6.15.0 (but most probably every version)
Intended outcome:
Use React 19.2.x with mobx in development mode and
observableRequiresReaction=truewithout being spammed by following warnings:[mobx] Observable 'someProp' being read outside a reactive context.Actual outcome:
With React 19.2.0, new performance tracks were introduced that show changed props for components:
https://react.dev/reference/dev-tools/react-performance-tracks#changed-props
If observable objects are passed into components, these performance tracks cause warnings if the
observableRequiresReactionis enabled:[mobx] Observable 'someProp' being read outside a reactive context.How to reproduce the issue:
See the following minimal reproduction sandbox:
https://codesandbox.io/p/sandbox/component-performace-tracks-mobx-warnings-c8wkwy
-> see warnings logged in the console
Does not happen with same sandbox when using React 19.1.4:
https://codesandbox.io/p/sandbox/component-performace-tracks-no-warnings-ttx7gt
Versions
react 19.2.0 and higher
mobx 6.15.0 (but most probably every version)