How to set inline style of background color with React?

Sometimes, we want to set inline style of background color with React.

In this article, we’ll look at how to set inline style of background color with React.

How to set inline style of background color with React?

To set inline style of background color with React, we set the backgroundColor style.

For instance, we write

<a style={{ backgroundColor: "yellow" }}>yellow</a>

to set the backgroundColor of the link to 'yellow' inline with the style prop.

Conclusion

To set inline style of background color with React, we set the backgroundColor style.