Welcome to part-9 of the series. You can find part-8 here. We will learn to style React component in this part.
Styling React Components
There are four ways to style React components. They are -
- CSS Stylesheets
- Inline styling
- CSS Modules
- CSS in JS Libraries — Styled components
We are going to look into first three in this post, as the fourth one is beyond basics and is a series in itself.
We will create a file StyleSheets.js inside components folder. Also, create a stylesheets.css file inside components folder.
We will put two class primary and secondary with color style in stylesheets.css file.