- Notifications
You must be signed in to change notification settings - Fork1k
chore: upgrade to react 19#19829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Everything looks good. Just had a few questions
//@ts-expect-error I would usually not hack around this, but this component | ||
// is going to be deleted imminently. |
ParkreinerSep 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we have an idea about whether this will be deleted soon? I'm always skittish about comments like these, and about how code like this ends up living for way longer than anyone wants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@aqandrew has been working on removing the last few usages of it
import{ | ||
Children, | ||
typeFC, | ||
typeJSX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not fully sure I understand the nuances of using this versus usingReactElement
. Are we basically usingJSX.Element
as an old legacy version ofReactElement
, since this is howJSX.Element
is defined?
interfaceElementextendsReact.ReactElement<any,any>{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not a fan of theJSX.Element
type, because there's almost always a more correct type available, but I think diving into the nuances of that is a concern for a separate PR
constmainParentNode=jsxChildren.find((node):node isReactElement=> | ||
isValidElement(node), | ||
); | ||
constmainParentNode=jsxChildren.find(isValidElement<PropsWithChildren>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Okay, now I'm confused about the feedback I got in an earlier PR aboutPropsWithChildren
Was the concern more about the TypeScript LSP performance, since passing an object type in would require that all properties get copied over to a new type definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't mind usingPropsWithChildren
, my problem is specifically withPropsWithChildren<T>
. the defaulted form is a handy shorthand for "this just takes children", but I think it's less obvious when used as a wrapper type, and can be made clearer by just specifyingchildren
directly.
return( | ||
<Alert | ||
actions={HealthMessageDocsLink(warning)} | ||
actions={<HealthMessageDocsLink{...warning}/>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oof, good catch
8db82d2
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Following theReact 19 Upgrade Guide
Future improvements that can come as a result of this upgrade:
react-helmet-async
in favor of React 19's<head>
supportforwardRef
Suspense
thanks touse