Home > OS >  TypeScript is complaining about missing component in React Bootstrap
TypeScript is complaining about missing component in React Bootstrap

Time:10-03

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.

CodePudding user response:

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

  • Related