Ad

How To Change CSS Attributes In React?

- 1 answer

I've imported a few different components in my React project, and most of them have .css files with preset style settings. For the most part, I've been manually changing the CSS files to suit my needs. Is there a way to change the CSS directly from React? That is, is there similar to jquery where i can find the corresponding classes and change the attributes?

Ad

Answer

For small changes here and there you can use React Inline Styles.

If you want to modify more things, you can create css/less/scss files that are local to your components and override the styles of imported components there. Here's a good example. Make sure to check the webpack configs that make that work.

Ad
source: stackoverflow.com
Ad