0

I have purchased a theme on ThemeForest which I would like to use with my ReactJS project. As I am still learning React, I would like to know if it is okay to simply include Style.css file in 'public/index.html' file just like I would do with any website or is there a way which is specific to React?

2 Answers 2

1

You can simply include the style.css file in your index.html and use the CSS classes defined in the stylesheet with your React components. One thing to note is that you have to use className instead of class to reference the CSS classes, because React is basically JavaScript code and “class” is a reserved word in JS. Example:

<div className="my-class">bla</div>
Sign up to request clarification or add additional context in comments.

Comments

1

That is an acceptable method.

Alternatively you can use something like require('./style.css') in your app entry point file, as long as you have something like webpack set up.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.