I firmly believe that separating styling from code enhances the clarity and cleanliness of the code. Personally, I have always viewed using inline styling (style={{}}
) as a bad practice.
In Mui V4, it was simple - I would create a styles file and import it into my component code using the makeStyles()
and useStyles()
hooks.
However, with the introduction of the new sx
prop in Mui V5, I am unsure how to avoid using inline styling. Any suggestions or ideas?