Add Inline CSS To A React Element
August - 2021
- Use a
style
propery with a object inside the{}
which results in{{ stuff }}
- Use camleCaseNames instead of kabob-case-names
const element = (
<div style={{fontStyle: 'italic', backgroundColor: 'red'}}>
this is inline CSS
</div>
)