-
Notifications
You must be signed in to change notification settings - Fork 1
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
MUI: Compat with React 19 types #619
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -41,13 +41,13 @@ describe('utils/getDisplayName.js', () => { | |||
)); | |||
NamedForwardRefComponent.displayName = 'Div'; | |||
|
|||
const AnonymousMemoComponent = React.memo((props, ref) => <div {...props} ref={ref} />); | |||
const AnonymousMemoComponent = React.memo((props) => <div {...props} />); |
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.
Was not caught previously because types assumed the ref
argument is actually the legacy context. Now that we removed legacy context, this bug is surface.
@@ -1001,13 +1001,17 @@ function GlobalVariantForm({ | |||
onRemove: (token: string) => void; | |||
}) { | |||
const [selectedVariant, setSelectedVariant] = React.useState<VariantProp>('solid'); | |||
const [states, setStates] = React.useReducer< | |||
StateReducer<{ hover: boolean; active: boolean; disabled: boolean }> |
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.
One less utility type 👍🏻
Emotion is informed, Next 13 no longer maintained, |
Will include necessary changes to be compatible with 19. Type-checking may still fail due to 3rd party libraries not being compatible.
Closes eps1lon/DefinitelyTyped#19
Changes
Mostly
ReactElement
->ReactElement<any>
changes. We have so many here, since MUI heavily relies on element introspection so the amount of breaking changes is expected. I'll write an opt-in codemod that would cover most of it.There was one with regards to
useReducer
which is also intended. In this case the new typing required isn't stricly better though.Unresolved Issues
@react-spring/web
uses the removed, global JSX namespace so it doesn't know about built-in components anymore. This lead to issues with e.g.<animated.div children={null} />
erroring becauseproperty 'children' does not exist on type ...
.Fixed by migration
@react-spring/web
to no longer use deprecated namespaces.@emotion/[email protected]
references deprecated global JSX namespace[email protected]
references deprecated global JSX namespaceTypechecking performance
No significant change as far as I can tell.
React 19 types coldstart: `pnpm tsc -p tsconfig.json --extendedDiagnostics`
React 18 types coldstart: `pnpm tsc -p tsconfig.json --extendedDiagnostics`