Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import multiple components from react-bootstrap?

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?

like image 590
David Klein Avatar asked Jan 03 '23 23:01

David Klein


1 Answers

Combine the import into one line:

import { DropdownButton, MenuItem } from 'react-bootstrap';
like image 66
David Klein Avatar answered Jan 12 '23 07:01

David Klein