Skip to content
Advertisement

TypeScript is complaining about missing component in React Bootstrap

Im trying to use Accordion in Bootstrap React but Visual Studio Code is complaining that it cant find it.

enter image description here

As the docs states I only needed to include a import of Accordion?

What I imported: import { Col, Row, Container, Form, Accordion } from "react-bootstrap";

How can I fix this? It’s not possible to import Accordion.Header for instance.

Advertisement

Answer

You can try using them as classes?

example: class=”accordion-header”. Give it a try.

Didn’t found anything on their docs.

Or

something like this: import { Col, Row, Container, Form, Accordion: { Body, Header} } from “react-bootstrap”;

Sorry for making it as an anwser, i can’t make comments yet

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement