React 18

Last Updated: 10/14/2023

Inline Styles

  • We can also use inline styles for styling components, similar to how we can use them in HTML and CSS.
  • Not recommended because inline styles make your code hard to read and maintain.
  • Use only for very special cases
  • Pass the styles as an object to the style property of an element
  • Use camelCase for style property names
<button style={{backgroundColor: "yellow"}}>Click</button>