Skip to content

Commit

Permalink
[system][zero] Consolidate the variants props callback arguments (#41222
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mnajdova committed Feb 21, 2024
1 parent 6432698 commit 7c3066b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mui-system/src/createStyled.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function processStyleArg(callableStyle, { ownerState, ...props }) {
variants.forEach((variant) => {
let isMatch = true;
if (typeof variant.props === 'function') {
isMatch = variant.props({ ownerState, ...props });
isMatch = variant.props({ ownerState, ...props, ...ownerState });
} else {
Object.keys(variant.props).forEach((key) => {
if (ownerState?.[key] !== variant.props[key] && props[key] !== variant.props[key]) {
Expand All @@ -80,7 +80,7 @@ function processStyleArg(callableStyle, { ownerState, ...props }) {
}
result.push(
typeof variant.style === 'function'
? variant.style({ ownerState, ...props })
? variant.style({ ownerState, ...props, ...ownerState })
: variant.style,
);
}
Expand Down

0 comments on commit 7c3066b

Please sign in to comment.