react / react/react

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

Open
#35,475 6 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Unconfirmed
Dominant language
JavaScript
Stars
251k
Forks
51.4k
Avg merge
2d 4h
Merged PRs (30d)
53

Description

React version: 19.2.x

Steps To Reproduce

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

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the React 19.2 component performance track behavior and reproduce the warning using the linked MobX CodeSandbox examples. Compare the 19.2.3 and 19.1.4 cases, then determine whether disabling the tracks or avoiding deep property enumeration best prevents side effects. Done means the reproduction emits no MobX warnings while the intended performance tracking remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.