1

what happens, is that in the project that I am working with, there is no use of bootstrap and therefore, it is a problem when I install bootstrap to use Reactstrap. I would like the component that I am currently using, use what I require of Reactstrap and not alter my whole project, since it overrides my project styles and that is wrong.

In my component I import the following:

import {
  ButtonDropdown,
  DropdownToggle,
  DropdownMenu,
  DropdownItem,
} from 'reactstrap';

And my view:

import '../../../node_modules/bootstrap/dist/css/bootstrap.css';

I would like to know how to make use of Reactstrap only for my view and component without altering the whole project. Thank you!

1 Answer 1

1

I think your best bet is going to be extracting only the css from bootstrap.css that you require for that component - this will have the benefit of not bloating your site.

Copy only the css classes required and put them in your own css file - then import that.

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

3 Comments

That I just did! however, do you think you should put it in a separate css file or mix it with the main css?
I think a separate file - that way it won't interfere with other components on other pages
Perfect, I just did it and everything works perfect. Thank you!

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.