I've just started using Material UI, and I know that it uses CSS in JS way of styling components.
I saw 2 methods in the documentation of how to create styles:
Using the sx prop:
<Box sx={{ backgroundColor: 'green' }}/>
Using the makeStyles method:
makeStyles({
root: {
backgroundColor: 'green'
}
})
I know that CSS in JS is much less performant than native CSS.
But between these 2 methods I just wrote, which one is more performant (if any)?
By the way, I'm using Material UI version 5, which claims to have better performance overall with emotion instead of JSS