What is the best way to work with dynamic styles in react-native-web? #2032
Unanswered
RWOverdijk
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can use CSS variables, but then your code will not be multiplatform. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This might be a really weird question.
With StyleSheet.create() you get classnames that can be used to apply styles to components. That's pretty awesome.
But what if I no longer need a style? I'm talking specifically about dynamic styles that are based on user input. I will create new classes using StyleSheet.create(), but the old classes will still be there. Can those be removed somehow?
It's not a huge deal, I'm just curious if it can.
Update: I just figured, perhaps another approach could be a way to update stylesheets/use css variables? Most of the changes I am talking about are related to colors and such. Those are all variables. If a stylesheet could be updated then those styles could be applied.
Beta Was this translation helpful? Give feedback.
All reactions