1

In bootstrap 4 docs, there're overflow-hidden and overflow-auto classes for elements, but in reactstrap if I try this:

<Col xs={3} className="overflow-hidden">
    <Sidebar/>
</Col>

That col does not get overflow: hidden. How to use overflow-{} classes in reactstrap?

UPD: It seems that that class doesn't exist:

Overflow search

1 Answer 1

2

You can make use of bootstrap classes with reactstrap as follows:

Install following dependencies

npm install --save [email protected]
npm install --save reactstrap

Add the following line in the component where you like to use Bootstrap 4 classes:

import 'bootstrap/dist/css/bootstrap.css';
Sign up to request clarification or add additional context in comments.

8 Comments

It doesn't work, unfortunately. <Col xs={3} className="overflow-hidden"> still has no effect with that import
If you inspect the code you can see that overflow-hidden class with overflow: hidden css is applied to your <div>
@NikitinRoman Do you have bootstrap installed (npm install --save bootstrap) and if yes what is the version of bootstrap, you can find this in your package.json
@NikitinRoman have tried it with "reactstrap": "7.0.0" and "bootstrap": "4.2.1", versions and its working you can have a look on the following fiddle: codesandbox.io/s/43kkrwry6w
Well, overflow is missing in 4.1.3, as it was added in 4.2.x, so technically the answer would be to update bootstrap to the latest version :)
|

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.