-
Notifications
You must be signed in to change notification settings - Fork 646
refactor: apply react-element-default-any-props codemod #7162
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: apply react-element-default-any-props codemod #7162
Conversation
|
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
…act-element-default-any-props-codemod
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.
Pull Request Overview
This PR applies the React 19 codemod for react-element-default-any-props, which explicitly adds the <any> type parameter to all React.ReactElement type annotations throughout the codebase. This is an internal TypeScript change required for compatibility with React 19's stricter typing requirements and has no impact on runtime behavior or the public API.
- Adds explicit
<any>type parameter to allReact.ReactElementandReactElementtype annotations - Affects type definitions in component props, function return types, and internal type utilities
- Maintains backward compatibility while preparing for React 19
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/utils/polymorphic.ts | Updated ForwardRefComponent interface return type |
| packages/react/src/stories/deprecated/ActionList.stories.tsx | Updated NextJSLikeLink return type |
| packages/react/src/internal/components/UnderlineTabbedInterface.tsx | Updated icon prop type in UnderlineItemProps |
| packages/react/src/experimental/SelectPanel2/SelectPanel.tsx | Updated Anchor variable type |
| packages/react/src/deprecated/ActionList/List.tsx | Updated RenderItemFn return type |
| packages/react/src/UnderlineNav/types.ts | Updated ResponsiveProps array element types |
| packages/react/src/UnderlineNav/UnderlineNavItem.tsx | Updated icon prop type |
| packages/react/src/UnderlineNav/UnderlineNav.tsx | Updated array element types for overflow calculations and helper functions |
| packages/react/src/TooltipV2/tests/Tooltip.test.tsx | Updated ExampleWithActionMenu parameter type |
| packages/react/src/Textarea/Textarea.tsx | Updated forwardRef return type |
| packages/react/src/SelectPanel/SelectPanelMessage.tsx | Updated action prop type |
| packages/react/src/SelectPanel/SelectPanel.tsx | Updated title, subtitle, notice text, message body/action, and footer prop types |
| packages/react/src/SelectPanel/SelectPanel.features.stories.tsx | Updated story type definitions for messages and notices |
| packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx | Updated icon prop type |
| packages/react/src/SegmentedControl/SegmentedControlButton.tsx | Updated leadingVisual and leadingIcon prop types |
| packages/react/src/SegmentedControl/SegmentedControl.tsx | Updated getChildIcon return type |
| packages/react/src/SegmentedControl/SegmentedControl.figma.tsx | Updated Figma icon prop type |
| packages/react/src/Radio/Radio.tsx | Updated forwardRef return type |
| packages/react/src/Overlay/Overlay.tsx | Updated BaseOverlay and Overlay forwardRef return types |
| packages/react/src/NavList/NavList.tsx | Updated React.cloneElement type assertion for subNav |
| packages/react/src/NavList/NavList.test.tsx | Updated NextJSLikeLink return type |
| packages/react/src/NavList/NavList.features.stories.tsx | Updated NextJSLikeLink return type |
| packages/react/src/FilteredActionList/types.ts | Updated RenderItemFn return type |
| packages/react/src/Details/Details.tsx | Updated Root forwardRef return type |
| packages/react/src/Checkbox/Checkbox.tsx | Updated forwardRef return type |
| packages/react/src/Button/types.ts | Updated icon, leadingVisual, and trailingVisual prop types |
| packages/react/src/Button/ButtonBase.tsx | Updated renderModuleVisual Visual parameter type |
| packages/react/src/Breadcrumbs/tests/Breadcrumbs.test.tsx | Updated renderWithTheme parameter type |
| packages/react/src/Breadcrumbs/Breadcrumbs.tsx | Updated array element types for items, visibleItems, menuItems, and helper function |
| packages/react/src/Autocomplete/AutocompleteMenu.tsx | Updated leadingVisual and trailingVisual prop types |
| packages/react/src/ActionMenu/ActionMenu.tsx | Updated children and ActionMenuAnchor prop types |
| packages/react/src/ActionMenu/ActionMenu.test.tsx | Updated ExampleWithTooltipV2 parameter type |
| packages/react/src/ActionList/ActionListContainerContext.tsx | Updated defaultTrailingVisual prop type |
| packages/react/src/ActionList/ActionList.examples.stories.tsx | Updated NextJSLikeLink return type |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/7038 |
|
🟢 ci completed with status |
llastflowers
left a comment
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.
✅
Closes https://github.com/github/primer/issues/6109
Applies the React 19 codemod for: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#changes-to-the-reactelement-typescript-type
Changelog
New
Changed
Removed
Rollout strategy
I believe this is a change that won't have a public impact and will only be an internal type change.