[system] compose with style function 'spacing' throws error #23649
Labels
package: system
Specific to @mui/system
support: question
Community support but can be turned into an improvement
Considering the general working of the compose function, it returns a style function combining multiple style functions passed to it. And the general working of a style function seems like it returns CSS Object when passed with a props object accepted by the style function.
So, I tried following code to see if it works as expected
This code compiles without any type error
Current Behavior 😯
At runtime, it throws this error
Expected Behavior 🤔
Should not throw error and output the expected CSS object
Steps to Reproduce 🕹
Here's the link to reproduce
https://codesandbox.io/s/material-ui-issue-forked-bblik?file=/src/Demo.js
Context 🔦
This would have been useful to style any component using material ui style system. So, i was trying to use styles which style functions return on a Card component, instead of using a Box component everywhere, this would have been quite handy.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: