Upgrade to React 19#6067
Open
fatadel wants to merge 1 commit into
Open
Conversation
React 19 narrowed the callback-ref signature to (instance) => void |
(() => void), where a returned non-void value is treated as a cleanup
function. Several _takeXxxRef handlers were written as
`(el) => (this._el = el)`, which implicitly returns the assigned value
and no longer satisfies the new type. They now use block bodies so
they return undefined.
@types/react v19 also changed React.createRef<T>() to return
RefObject<T | null> instead of the legacy split between RefObject and
MutableRefObject. MaybeFlameGraph's _flameGraph field declares the new
shape directly so the assignment continues to typecheck.
React 19 appends "(<anonymous>)" to component-stack frames whose
component lacks a source location, so the ErrorBoundary regex now
allows that suffix on the NonLocalizedErrorBoundary frame. React 19
also follows the HTML spec for boolean attributes on custom elements
(prop={false} drops the attribute entirely); the Home tests mock
ListOfPublishedProfiles as a custom-element string, so the affected
snapshots no longer carry withactionbuttons="false".
Closes firefox-devtools#5590
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6067 +/- ##
=======================================
Coverage 83.77% 83.77%
=======================================
Files 329 329
Lines 34547 34549 +2
Branches 9667 9669 +2
=======================================
+ Hits 28943 28945 +2
Misses 5175 5175
Partials 429 429 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
React 19 narrowed the callback-ref signature to (instance) => void | (() => void), where a returned non-void value is treated as a cleanup function. Several _takeXxxRef handlers were written as
(el) => (this._el = el), which implicitly returns the assigned value and no longer satisfies the new type. They now use block bodies so they return undefined.@types/react v19 also changed React.createRef() to return RefObject<T | null> instead of the legacy split between RefObject and MutableRefObject. MaybeFlameGraph's _flameGraph field declares the new shape directly so the assignment continues to typecheck.
React 19 appends "()" to component-stack frames whose component lacks a source location, so the ErrorBoundary regex now allows that suffix on the NonLocalizedErrorBoundary frame. React 19 also follows the HTML spec for boolean attributes on custom elements (prop={false} drops the attribute entirely); the Home tests mock ListOfPublishedProfiles as a custom-element string, so the affected snapshots no longer carry withactionbuttons="false".
Closes #5590
Profile