React 19.2x 引入了性能追踪,导致可观测对象在反应之外被访问
作者: ahoisl创建于 2026年1月9日更新于 2026年8月20日
标签🐛 bug
预期结果:
在开发模式下使用 React 19.2.x 与 mobx,并将 observableRequiresReaction=true 设置为 true,以避免接收以下警告:[mobx] Observable 'someProp' being read outside a reactive context。
实际结果:
在 React 19.2.0 中,引入了新的性能跟踪,显示组件的更改属性:https://react.dev/reference/dev-tools/react-performance-tracks#changed-props
内容来源: mobxjs/mobx