How to use Radium in React for inline styling?
Pseudo selectors and media queries are generally used for inline styling. So, in this article, we will see how to use Radium in React for inline styling. Radium is a popular npm package for React which allows users to use inline styling with pseudo selectors and media queries. Without this third-party package, users can not do inline styling with pseudo selectors. This is because React doesn’t allow users to use pseudo-selectors in inline styling. Examples of pseudo-selectors are hover, visited, link, etc. Example: So, here is an example of styling a button having a hover(pseudo selector) effect. Step 1: Make a new folder for the project. Step 2: Now in your terminal, run the following command from the root of your project folder for installing create-react-app and saving it globally. $ npm install create-react-app -g Step 3: Now create a sample react app using the command in your terminal. Name it my-app. $ create-react-app my-app Step 4: You ...