From 65622f25ed3ce44560babb9a24f9dd7cb4e3964f Mon Sep 17 00:00:00 2001 From: DiegoAndai Date: Thu, 23 May 2024 08:24:21 -0400 Subject: [PATCH] Intercept props and ownerState ownerState key --- packages/mui-system/src/createStyled/createStyled.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-system/src/createStyled/createStyled.js b/packages/mui-system/src/createStyled/createStyled.js index 3c01934e020172..9c23e27b95afbc 100644 --- a/packages/mui-system/src/createStyled/createStyled.js +++ b/packages/mui-system/src/createStyled/createStyled.js @@ -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, ...ownerState }); + isMatch = variant.props({ ...props, ...ownerState, ownerState }); } else { Object.keys(variant.props).forEach((key) => { if (ownerState?.[key] !== variant.props[key] && props[key] !== variant.props[key]) {