Declaration or statement expected with react bootstrap

点点圈 提交于 2020-08-07 05:31:47

问题


I'm trying to use react-bootstrapwith Typescript, but I got this error.

/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';

回答1:


I have actually just run in to this issue as well. It seems that you need to upgrade to TS 3.8 or downgrade react-bootstrap to 1.0.1... please see this now closed issue... https://github.com/react-bootstrap/react-bootstrap/issues/5281

(would have put it in a comment but not allow...)



来源:https://stackoverflow.com/questions/62939139/declaration-or-statement-expected-with-react-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!