Skip to content

chore: fix react 19 integration tests type issues for v9 - #34722

Merged
Martin Hochel (Hotell) merged 11 commits into
microsoft:masterfrom
dmytrokirpa:chore/fix-react-19-stories-type-issues
Jul 31, 2025
Merged

Martin Hochel (Hotell) merged 11 commits into
microsoft:masterfrom
dmytrokirpa:chore/fix-react-19-stories-type-issues

Conversation

@dmytrokirpa

@dmytrokirpa Dmytro Kirpa (dmytrokirpa) commented Jun 25, 2025 •

Copy link
Copy Markdown
Contributor

Previous Behavior

react-19-tests-v9:type-check:integration task was failing with 126 TS issues

image

New Behavior

This PR fixes all those issues:

image

Changes:

  • JSX.Element => React.ReactElement - there is no global namespace JSX in React 19, we should use React.JSX.Element or React.ReactElement
  • React.useRef requires the intitialValue to be set (here is how it was in React 18 and here how it's look like in 19)

Related Issue(s)

@github-actions

github-actions Bot commented Jun 25, 2025 •

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the chore/fix-react-19-stories-type-issues branch 2 times, most recently from 902dd80 to dd84de5 Compare June 25, 2025 16:05
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) marked this pull request as ready for review June 26, 2025 07:33

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other than pending TODO everything looks good.

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) requested a review from a team as a code owner June 26, 2025 14:22
@Hotell

Martin Hochel (Hotell) commented Jul 1, 2025 •

Copy link
Copy Markdown
Contributor

JSX.Element => React.ReactElement - there is no global namespace JSX in React 19, we should use React.JSX.Element or React.ReactElement

that's not best approach, as it's not backward compatible. We will use our own types #34733


The changes to stories didn't trigger the r19 integration test task on CI.

that's odd, same input globs are specified in all the integration testing apps which work. lets undo the implicit dependency and troubleshoot what went actually wrong.


have you used DT codemod for this ? https://github.com/eps1lon/types-react-codemod

  • we should use it as a go to tool as we recommend it to our users, to find and document potential glitches.

};

export type AccordionProps<Value = AccordionItemValue> = ComponentProps<AccordionSlots> & {
export type AccordionProps<Value = AccordionItemValue> = Omit<ComponentProps<AccordionSlots>, 'onToggle'> & {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we have custom onToggle callback prop and it conflicts with the native element prop.

@dmytrokirpa Dmytro Kirpa (dmytrokirpa) changed the title chore: fix react 19 type issues for v9 component stories chore: fix react 19 type issues for v9 Jul 28, 2025
@dmytrokirpa Dmytro Kirpa (dmytrokirpa) changed the title chore: fix react 19 type issues for v9 chore: fix react 19 integration tests type issues for v9 Jul 28, 2025
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the chore/fix-react-19-stories-type-issues branch from 83033b0 to f998c6e Compare July 31, 2025 11:31
@Hotell
Martin Hochel (Hotell) merged commit 3e65d7d into microsoft:master Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants