Dynamic styles (unknown at runtime) #1035
-
I have a component to resize images. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
depends ! if that value is dynamically retrieved but still deterministic, meaning this will NOT change at runtime, then you could use if that value will change at runtime, then not everything has to be static css, so you can just use the |
Beta Was this translation helpful? Give feedback.
depends !
if that value is dynamically retrieved but still deterministic, meaning this will NOT change at runtime, then you could use
config.staticCss
with all the known values of width that you can prefetch and import in the config to pregenerate those classNamesif that value will change at runtime, then not everything has to be static css, so you can just use the
style
attribute on your component<div style={{ width: props.width }} />