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
[material-ui][Drawer] React does not recognize the slotProps prop #42106
Comments
slotProps
to a Drawer
component causes React to complain only on desktop "React does not recognize the slotProps
prop on a DOM element."
Hey, thanks for opening the issue! Could you provide a minimal reproduction? It helps us troubleshoot. A live example would be perfect. This StackBlitz sandbox template may be a good starting point. |
Hey @danilo-leal , yes I can create that for you here you go: https://stackblitz.com/edit/stackblitz-starters-wcks5r?file=src%2FApp.tsx We switch from Hopefully this helps! |
Steps to reproduce
Link to live example: (required)
Steps:
slotProps={{ backdrop: { onClick: onCloseNav } }}
to itCurrent behavior
When loading the
Drawer
component on desktop withslotProps
passed to it, it complains that React doesn't recognise this prop on a div HTML DOM element.Expected behavior
It shouldn't complain error out.
Context
I want to close the drawer when the backdrop is clicked, so I need to pass the
onClick
listener for the backdrop through theslotProps
of theDrawer
component.Your environment
npx @mui/envinfo
Search keywords: slotProps drawer component
The text was updated successfully, but these errors were encountered: