Next, define a new state bgColour and give it an initial value of #fafafa. React lets you add CSS inline, written as attributes and passed to elements. CSS below. But there are some exceptions, few CSS properties are unitless, check the full list of unitless properties here . It is a different way to add the styles in your react application. You can see the above code in action by hovering on the button. Pros Our JSX looks beautiful, as we can reuse our
2020 hover inline css react