#style={{..}} VS style props

27 messages · Page 1 of 1 (latest)

forest mason
hidden ore
#

use sx or styles then

forest mason
hidden ore
#

he does? didnt know about that

#

style will add it as the normal html style tag, the component will be <div style="min-height: 100vh" />

#

styles or sx will create an emotion class for it

forest mason
hidden ore
#

thats the difference

forest mason
#

but does it has any effect in practice?

hidden ore
#

well, usually you'd rather avoid adding styles directly

forest mason
#

the scope of the question is, for inline styling, is there any drawback for using the standard style={{}} compared to mantine specifics props such as mih

hidden ore
#

but in practice you wouldnt have the theme

forest mason
#

I guess the benefit of using the inline mantine prop such as w is to enable providing responsive values

#

but my questions was not this.

#

thank you for your answer though

#

if nothing breaks, then i prefer to use the standard inline style thing because it does not require any learning while having the same effect

hidden ore
#

thats style props, its different from sx

forest mason
#

yes, i never mentionned sx

hidden ore
#

yes, i mentioned sx because it styles the same way you do with style but creates a class and you can subscribe to theme

#

if you plan to use style probably would be better to use sx instead

#

wont change nothing in the way you stlye

forest mason
#

ok thanks

#

as for the discussion of the sx removal, its in the insight chanel

silver patrol