gpt4 book ai didi

reactjs - 如何导入 "useAccordionButton"?

转载 作者:行者123 更新时间:2023-12-05 04:44:46 27 4
gpt4 key购买 nike

使用“ react 引导”

import { useAccordionButton } from 'react-bootstrap/AccordionButton';

给出错误信息:

Module not found: Can't resolve 'react-bootstrap/AccordionButton'

npm list

bsn-gui@0.1.0 C:\goproj\src\github.com\amortaza\bsn-gui
├── @testing-library/jest-dom@5.14.1
├── @testing-library/react@11.2.7
├── @testing-library/user-event@12.8.3
├── bindings@1.5.0 extraneous
├── bootstrap@5.1.1
├── file-uri-to-path@1.0.0 extraneous
├── nan@2.15.0 extraneous
├── react-bootstrap-validation@0.1.11
├── react-bootstrap@1.6.3
├── react-dom@17.0.2
├── react-scripts@4.0.3
├── react-split@2.0.13
├── react@17.0.2
└── web-vitals@1.1.2

最佳答案

Accordion.Button 在 react-bootstrap v5 (v2.0.0-rc0) 中可用

Accordion.Button

您安装了 v4 react-bootstrap@1.6.3

卸载当前版本并安装最新版本。

npm uninstall -S react-bootstrap
npm install -S react-bootstrap@2.0.0-rc.0

关于reactjs - 如何导入 "useAccordionButton"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69277497/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com