Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
aslilac merged 7 commits intomainfromlilac/react-19
Sep 16, 2025
Merged

chore: upgrade to react 19#19829

aslilac merged 7 commits intomainfromlilac/react-19
Sep 16, 2025

Conversation

aslilac
Copy link
Member

@aslilacaslilac commentedSep 15, 2025
edited
Loading

Following theReact 19 Upgrade Guide

  • Upgraded to react@19, react-dom@19, @types/react@19, and @types/react-dom@19
  • Ran the default codemod
  • Ran the TypeScript codemod
  • Fixed a few additional types by hand
  • Fixed formatting and some linting issues

Future improvements that can come as a result of this upgrade:

  • Removereact-helmet-async in favor of React 19's<head> support
  • Remove usage offorwardRef
  • Better utilization ofSuspense thanks touse
  • React Compiler 👀

@aslilacaslilac changed the titlechore: upgrade to react 19chore: upgrade react to version 19Sep 15, 2025
Copy link
Member

@ParkreinerParkreiner left a 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

Comment on lines +149 to +150
//@ts-expect-error I would usually not hack around this, but this component
// is going to be deleted imminently.
Copy link
Member

@ParkreinerParkreinerSep 16, 2025
edited
Loading

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

Copy link
MemberAuthor

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,
Copy link
Member

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>{}

Copy link
MemberAuthor

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>);
Copy link
Member

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?

Copy link
MemberAuthor

@aslilacaslilacSep 16, 2025
edited
Loading

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}/>}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oof, good catch

@aslilacaslilac merged commit8db82d2 intomainSep 16, 2025
36 checks passed
@aslilacaslilac deleted the lilac/react-19 branchSeptember 16, 2025 19:37
@aslilacaslilac changed the titlechore: upgrade react to version 19chore: upgrade to react 19Sep 16, 2025
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ParkreinerParkreinerParkreiner approved these changes

Assignees

@aslilacaslilac

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@aslilac@Parkreiner

[8]ページ先頭

©2009-2025 Movatter.jp