Reactstrap button link to section on same page

Viewed 922

I'm trying to link a button imported from reactstrap to a specific section on my page. I tried many different solutions but none of them seem to work. Here's how it looks now:

2.  import { Button, Card, CardBody, CardTitle, Row, Col, CardImg, CardText } from 'reactstrap';
...
...
23. <Button href="#jump">Thrift shops</Button>
...
...
69. <h5 id="jump">Near city center</h5>

So I'm trying to jump to the line 69 from the button used on line 23. I'm lost...

2 Answers

Button does not support href attribute. You need to use <a> tag for that i.e

<a href="#jump">Thrift shops</a>

Import Bootstrap CSS in the src/index.js file:

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

Related