4

I am trying to build a dropdown menu, so I import both DropdownButton and MenuItem.

import { DropdownButton } from 'react-bootstrap';
import { MenuItem } from 'react-bootstrap';

However, I see the following error:

error  'react-bootstrap' import is duplicated  no-duplicate-imports

How do I import both components from react-bootstrap?

1
  • import { DropdownButton, MenuItem } from 'react-bootstrap'; Commented May 31, 2017 at 16:37

1 Answer 1

9

Combine the import into one line:

import { DropdownButton, MenuItem } from 'react-bootstrap';
Sign up to request clarification or add additional context in comments.

1 Comment

Do you know how to import all from react-bootstrap. I get an error when trying to import * as ReactBootstrap from 'react-bootstrap'

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.