dillon1000/react
Commit
Browse files [bug fix] revert values in ReactFiberFlags to keep consistency for devtools (#25832)
## Summary We see recent bug reports like #25755 and #25769 for devtools. Whenever a component uses hook `useEffect`, it triggers an error. This was introduced in #25663 when we try to keep the `ReactFiberFlags` numbers consistent with reconciler, in order to fix an issue with server components. However, the values of `ReactFiberFlags` in reconciler were actually changed a while ago in https://github.com/facebook/react/commit/b4204ede66284e7153ffb11fd434cd9b9a64a56f We made this mistake because, although it's not mentioned in the comment, `DidCapture` and `Hydrating` are actually used by DevTools This caused - the latest (not stable) react version is broken on devtools before 4.27.0 (but only in uncommon cases such server components) - all earlier react versions are broken on latest devtools (4.27.0) To keep most versions work, we need to revert the commit that changed the `ReactFiberFlags` values ## How did you test this change? 1. add a `useEffect` in a component in the TodoList of the shell, trigger the error in devtools 2. after change, the error is gone
Changed paths2 files
First-parent comparisonpackages/react-devtools-shared/src/backend/ReactFiberFlags.js ModifiedM packages/react-reconciler/src/ReactFiberFlags.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…