chirag prajapati
chirag prajapati

Reputation: 589

How to add javascript external file like bootstrap , jQuery to reactjs app

I am new to ReactJs, I have bootstrap.min.js, jquery.min.js, etc static file in my assets folder. I have to add those file to my ReactJs App, I had tried but it's not working.

I had added the below code to the index.html but it's not working

<script src="./assets/js/jquery.min.js"></script>
<script src="./assets/js/bootstrap4.min.js"></script>
<script src="./assets/js/vendor/Chart.bundle.min.js"></script>

Upvotes: 0

Views: 94

Answers (2)

jithin
jithin

Reputation: 101

The best way which I have used is via npm (yarn) package which you can directly install bootstrap into your project

npm install react-bootstrap bootstrap

Upvotes: 3

ArggBake
ArggBake

Reputation: 101

Other users have mentioned using npm install <package>. If you've used create-react-app (or have yarn installed) I wanted to add that you can also use yarn add <package> for jQuery. Both work well.

Upvotes: 0

Related Questions