简体   繁体   中英

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.

在此处输入图像描述

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM