Style

A pretty significant difference is the way the style attribute works. We will look at how to use it in more detail in Chapter 7Make Your Components Look Beautiful, but now we will focus on the way it works.

The style attribute does not accept a CSS string as the HTML parallel does, but it expects a JavaScript object where the style names are camelCased:

  <div style={{ backgroundColor: 'red' }} />
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.237.255