-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[Popper] Incompatible props: onResize
and onResizeCapture
#35287
Comments
I have the same issue on
same Typescript error: |
Definitely wasn't expecting a patch release to blow up my build... getting this:
|
This comment was marked as resolved.
This comment was marked as resolved.
Not working either with 5.10.15 or 5.10.14 |
<Popper
onResize={undefined}
onResizeCapture={undefined}
...
/> will mitigate the issue until future fix 😉 Although this might throw in your tests:
😕 |
In my case the problem is that I can't even build the project using vite.js, I'm not using directly Popper |
@IdoiaRojo If you don't use |
Can confirm I am seeing this on popper when bumping versions up between this version of MUI 5.10.16
5.10.15
I.E. a patch release w/ no release note about Breaking changes should be hot fixed/prioritized with the last minor being reverted and rereleased to not break auto bumping from builds. |
@michaldudak @oliviertassinari This blew up a few of our CI's because this break was updated in the latest patch release. |
Could you upgrade |
Couldn't test it b/c that requires react 18. Speaking for us, we're not there yet, and just made it to MUI 5 (more ore less). But at least when updating to |
Tagging @mui/core since it looks like a high priority issue. I am not certain if it's related to #35273. Also not sure what's the fix but I think we need to support latest version of |
onResize
and onResizeCapture
I'm looking into it. |
I understand it occurs only when using React 17, right? |
It seems that the issue is caused by a type mismatch between @types/react@17 and @types/react@18. declare global {
namespace React {
interface DOMAttributes<T> {
onResize?: ReactEventHandler<T> | undefined;
onResizeCapture?: ReactEventHandler<T> | undefined;
nonce?: string | undefined;
}
}
} Solving this "properly" is a pickle, to be honest. Apparently DefinitelyTyped can't add these two fields to React 17 typings, because they are only supported in 18. We may have to live with this workaround for longer, unfortunately. |
Minor addition: I had to do the same approach with the |
Just to help ^ this also occurs on react 18 unless using the latest react/types - upgrading that removed this for me |
How about using |
Sorry, I'm not a familiar with the development workflow here and would like to ask when is expected to be release ? |
I also wasn't able to fix the problem with @types/react 18.0.26 at first but knowing that the TS compiler in VS Code is stubborn at times I restarted VS Code and the problem has gone now. |
Works for me with |
Looks good in our project. We're using |
I made some additional changes. Could you please once again verify the build? The latest bits are available at https://pkg.csb.dev/mui/material-ui/commit/ff29f383/@mui/material
@MartinYankovPP once the PR is approved, I'll merge it, and it'll land in the next release. We usually release new versions on Mondays, so there's a chance it'll be the next one. |
Haven't done much testing, but |
Thanks, the new commit also looks good to me. At least doesn't make any problems for the build. |
I think that The type declaration using Would it be possible to rewrite the type declaration using
|
The |
Is this now deployed? I can still see the error on
|
Not yet, you can see release notes here, so far it's not included, maybe next Monday :) |
Cheers! I've just seen it merged to master so I immediately thought it went out. |
It's just been released in https://github.com/mui/material-ui/releases/tag/v5.11.8 |
Awesome, thanks! |
I'm using 5.11.8 but still hitting this TS error (using tsc version 4.7.4, react 17.0.2) |
Just upgraded to |
Is the Popper causing the issue or some other component? |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
Steps:
PopperComponent={popperProps => <Popper {...popperProps} />
Current behavior 😯
Typescript error:
Type '{ anchorEl: HTMLDivElement | undefined; style: { width: number | undefined; }; key?: Key | null | undefined; className?: string | undefined; component?: "div" | undefined; ... 268 more ...; sx?: SxProps<...> | undefined; }' is missing the following properties from type 'Pick<PopperProps, "key" | "className" | "style" | "component" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | ... 265 more ... | "onResizeCapture">': onResize, onResizeCapture
PopperUnstyledOwnProps in
mui/base
does not provide the onResize and onResizeCapture props picked by themui/material
Popper components props
Expected behavior 🤔
No Typescript error
Context 🔦
We have to pin @mui/material to version 5.10.15 in order to build our project even though we would prefer to do minor upgrades automatically.
Workaround
See #35287 (comment).
Your environment 🌎
System:
OS: Linux 5.10 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
Binaries:
Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
Yarn: 3.2.0 - ~/.nvm/versions/node/v16.18.1/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
Browsers:
Chrome: Not Found
Firefox: 106.0.2
npmPackages:
@emotion/react: 11.10.5
@emotion/styled: 11.10.5
@mui/base: 5.0.0-alpha.108
@mui/core-downloads-tracker: 5.10.16
@mui/icons-material: 5.10.16
@mui/lab: 5.0.0-alpha.110
@mui/material: 5.10.16
@mui/private-theming: 5.10.16
@mui/styled-engine: 5.10.16
@mui/styles: 5.10.16
@mui/system: 5.10.16
@mui/types: 7.2.2
@mui/utils: 5.10.16
@types/react: ^17.0.44 => 17.0.52
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ~4.6.4 => 4.6.4
The text was updated successfully, but these errors were encountered: