Three Major Ways to Style a React Component
Inline CSS This is the CSS styling sent to the element directly using the HTML or JSX. You can include a JavaScript object for CSS in React components, although there are a few restrictions such as camel casing any property names which contain a hyphen. Example: import React from "react"; const spanStyles = { color: "#fff", borderColor: "#00f" }; const Button = props => ( <button style={{ color: "#fff", borderColor: "#00f" }}> <span style={spanStyles}>Button Name</span> </button> ); Styled-Components Styled-components is a library that utilizes tagged template literals — which contain actual CSS code between two backticks — to style your components....