Answer the question
In order to leave comments, you need to log in
How to display styles depending on a variable?
There is a div with inline styles, you need to display these styles or not, depending on the variable. Is it possible to do this? I say right away that styles are needed, classes do not fit here.
Answer the question
In order to leave comments, you need to log in
<div style={true ? { backgroundColor: 'red' } : {}}>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question