How can one use inline CSS with a dash in the name of the property in React?
My parser throws the following error when I do:
TS1005:
The parser expected to find a '}' to match the '{' token here.
For example:
<div style={{background-color:blue}}/>
Usually inline CSS in React does not include the dash. So background-color would be backgroundColor.
See e.g. Styling React Using CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With