gpt4 book ai didi

typescript - react bootstrap 预期的声明或声明

转载 作者:行者123 更新时间:2023-12-04 11:13:25 25 4
gpt4 key购买 nike

我正在尝试使用 react-bootstrap使用 Typescript,但我收到此错误。

/home/vagnerwentz/Documents/www/wecanclub/node_modules/react-bootstrap/esm/index.d.ts
TypeScript error in /home/vagnerwentz/Documents/www/wecanclub/node_modules/react-bootstrap/esm/index.d.ts(2,1):
Declaration or statement expected. TS1128

1 | export { default as Accordion } from './Accordion';
> 2 | export type { AccordionProps } from './Accordion';
| ^
3 | export { default as AccordionContext } from './AccordionContext';
4 | export { default as AccordionCollapse } from './AccordionCollapse';
5 | export type { AccordionCollapseProps } from './AccordionCollapse';

最佳答案

我实际上也刚刚遇到了这个问题。
看来你需要升级到 TS 3.8 或者将 react-bootstrap 降级到 1.0.1。
检查这个关闭的问题:
https://github.com/react-bootstrap/react-bootstrap/issues/5281

关于typescript - react bootstrap 预期的声明或声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62939139/

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