I have a React application and want to change a CSS class when one condition is met or another. How do I do this?
So, if validation
or validationNoExist
is false
then the CSS class should be input-form-validation-wrong
, if both are correct then the first class is selected.
Here is my code:
<input type="email" className={validation || validationNoExist ? 'input-form' : 'input-form-validation-wrong'} placeholder="E-Mail" />