As you apply css style to many components you will realize that you want to have consistent style to be applied to your web/mobile application easy way to change the style depending on some conditions style-components provides an easy way for that – theme. You can define a theme which could be applied to the app globally. Define a theme This could be in separate files if you would like to have multiple themes. In this example, I defined two themes – light and dark – in separate files. I typically place the theme files under components/thems folder. light.js dark.js READ MORE
Tag: react styled component v5
React Styled Component V5 Basics
Styled component is a very useful and convenient library for react styling. Although there are many other choices (or you don’t even need to use as you can directly apply css) there is a definite advantage such as performance. Install Make sure react app is created by running the following command After successful creation, run Basic Usage Let’s create a button react component and apply some css. In order to use styled component you just need to choose styled.<component> – in this case I used button but you can use div, h1, span and etc – and apply css styles READ MORE