Skip to content

Bug: React 19.2 component performance track causes side-effects in mobx -> add way to disable? #35475

Description

@ahoisl

React version: 19.2.x

Steps To Reproduce

See mobxjs/mobx#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

The current behavior

Warnings logged since keys & values of component properties are enumerated in performance tracks, e.g.:
[mobx] Observable 'someProp' being read outside a reactive context.

The expected behavior

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions