You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to use styles in React? in REACT

Practice



style
The attribute accepts a JavaScript object with camelCased properties, rather than CSS strings. This is consistent with the DOM style JavaScript property, is more efficient and prevents XSS security holes.
const  divStyle  = { color :  ' blue ' , backgroundImage :  ' url ( '  +  imgUrl  +  ' ) ' };

function  HelloWorldComponent () { return < div  style = { divStyle } > Hello World! </ div > }

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

node.style.backgroundImage
).

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone