How to use styles in React?

Posted by Prem Tiwari | Updated on

How to use styles in React?

The style attribute accepts a JavaScript object with camelCased properties rather than a CSS string. This is consistent with the DOM style JavaScript property, is more efficient, and prevents XSS security holes.

Style keys are camelCased in order to be consistent with accessing the properties on DOM nodes in JavaScript (e.g.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers