0

When i try to use jquery and bootstrap. I received the below error

Import in body of module; reorder to top  import/first

Find the below order which i am using.

import React, {Component} from 'react'
import jquery from 'jquery';
window.$ = window.jQuery=jquery;
import { Navbar, Nav, NavItem, Glyphicon, MenuItem, NavDropdown } from 'react-bootstrap';

Please help me to import bootstrap and jquery in reactjs

3
  • You shouln't use Jquery with React, If you want to make use of react-bootstrap, you don't actually need jquery but only Bootstrap css Commented Jun 19, 2017 at 18:06
  • Can you help me how to do that. I have make changes by removing jquery but still bootstrap classes are not getting affected. Commented Jun 20, 2017 at 6:27
  • Have a look at this answer: stackoverflow.com/questions/40784226/… Commented Jun 20, 2017 at 6:30

1 Answer 1

0

Move the jQuery window assignment below the react-bootstrap import. As someone already mentioned, you don't need to import your own jQuery to use react-bootstrap. Have a look at their installation instructions and you'll see that the only required deps are react and react-dom.

Sign up to request clarification or add additional context in comments.

2 Comments

Can you give me one sample please.
Yeah, I posted a link to their docs with lots of examples. Check it here react-bootstrap.github.io/getting-started.html

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.