0

I want to access bootstrap classes in my react app.

So at the top of App.js I put :

import 'jquery/dist/jquery.min.js'
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js';

But when I run the app I get

Error: Bootstrap's JavaScript requires jQuery ▼ 13 stack frames were expanded. ./node_modules/bootstrap/dist/js/bootstrap.min.js node_modules/bootstrap/dist/js/bootstrap.min.js:6 webpack_require /Users/levkowalski/Dropbox/Dev Work/react/game/webpack/bootstrap 4a4600e4aeb932c83f04:669 fn /Users/levkowalski/Dropbox/Dev Work/react/game/webpack/bootstrap 4a4600e4aeb932c83f04:87 ./src/App.js http://localhost:3000/static/js/bundle.js:41844:93

Why is that happening since I loaded jQuery globaly just before ?

3
  • Use react-strap specially made for react applications. Some people say it is not a good idea to use jquery with react js because react js has its own virtual DOM. Commented Oct 8, 2017 at 13:02
  • Remeber react-strap is made with bootstrap 4 idk about bootstrap 3. Commented Oct 8, 2017 at 13:43
  • stackoverflow.com/questions/41778884/… Hope this helps! Commented Oct 8, 2017 at 14:32

0

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.