-
Notifications
You must be signed in to change notification settings - Fork 221
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
chore: Upgrade to React 18 #1636
chore: Upgrade to React 18 #1636
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…canvas-kit into upgrade-to-react-18
return ( | ||
<Flex | ||
as={Element} |
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.
Kind of a sneaky change to a real polymorphic component.
export interface ActionBarListProps<T = unknown> | ||
extends Partial<ExtractProps<typeof HStack, never>> { | ||
export interface ActionBarListProps<T = any> | ||
extends Omit<Partial<ExtractProps<typeof HStack, never>>, 'children'> { |
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.
Why is omitting children
necessary now and not before? HStack
always had children
as part of the interface. Wouldn't that clash before?
@@ -30,7 +30,7 @@ export interface ActionBarListProps<T = unknown> | |||
* {(item) => <ActionBar.Item key={item.id} name={item.name}>{item.text}</ActionBar.Item>} | |||
* </ActionBar.List> | |||
*/ | |||
children: ((item: T) => React.ReactNode) | React.ReactNode; | |||
children: ((item: T, index: number) => React.ReactNode) | React.ReactNode; |
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.
Good catch
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 wonder if this shouldn't use ListBoxProps
instead.
@@ -84,15 +84,15 @@ describe('Popper', () => { | |||
|
|||
// force PopperJS to run | |||
// eslint-disable-next-line compat/compat | |||
await act(() => new Promise(requestAnimationFrame)); | |||
await act(() => new Promise<any>(requestAnimationFrame)); |
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.
Why is this any
needed? It should extract the type from requestAnimationFrame
, but we don't actually care about the return type.
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.
ReactDOM test utils changed the type of the promise that could be returned to act
and forced it to be void
even though the promise return type is ignored. requestAnimationFrame
takes a callback that expects a number
and they 2 come into conflict.
The alternative is:
await act(() => new Promise(cb => requestAnimationFrame(() => cb())));
But that seems messier
@@ -17,7 +17,8 @@ import { | |||
import {useTabsModel} from './useTabsModel'; | |||
|
|||
// Use `Partial` here to make `spacing` optional | |||
export interface TabListProps<T = unknown> extends Partial<ExtractProps<typeof Stack, never>> { | |||
export interface TabListProps<T = any> | |||
extends Omit<Partial<ExtractProps<typeof Stack, never>>, 'children'> { |
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 wonder if ExtractProps
should remove children... It is easier to add children
than to take it away. I don't like using Omit
as the type becomes much messier. All the Extract*
utility types avoid using it and instead return clean interfaces
Note, I'm removing this text from the PR description as a correction.
|
Summary
react
andreact-dom
to v18@types/react
and@types/react-dom
to v18Resolved: #1527
Checklist