Currently, in my React app I have this,
<input style={{ borderColor: valid ? null : "red", boxShadow: valid ? null : "rgb(2, 0, 0)"}} />
If I have more styling to do, it doesn't make sense checking the same condition again and again right? I wish to make the entire style attribute optional; something like this,
<input valid ? null : style={{ borderColor: "red", boxShadow: "rgb(2, 0, 0)"}} />
But I know that's not the right syntax. Isn't there a better way to do this?