You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the component that uses useSlotProps, you must both:
use useSlotProps without passing getSlotProps, AND
do not explicitly destructure a className prop and pass it into the className parameter of useSlotProps, we want it go to into externalForwardedProps instead
Duplicates
Latest version
Steps to reproduce 🕹
Sandbox: https://codesandbox.io/s/merge-slot-props-classes-order-w9tkzp?file=/src/App.tsx
In the component that uses
useSlotProps
, you must both:useSlotProps
without passinggetSlotProps
, ANDclassName
prop and pass it into theclassName
parameter ofuseSlotProps
, we want it go to intoexternalForwardedProps
insteadCurrent behavior 😯
When
getSlotProps
is not passed, the className join order is:When it is passed, the join order is:
Expected behavior 🤔
Disregarding
internalSlotProps.className
, the order of the rest should be the same.Context 🔦
I was investigating why this test broke after refactoring
material-next/InputLabel
to useuseSlotProps
For more background, the test was added in #33205 and #34451
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: