Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Declaration or statement expected with react bootstrap

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';
like image 293
Vagner Wentz Avatar asked Jul 16 '20 16:07

Vagner Wentz


2 Answers

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. Check this closed issue:
https://github.com/react-bootstrap/react-bootstrap/issues/5281

like image 118
sfq Avatar answered Nov 01 '22 10:11

sfq


I tried this code and it was fixed

npm i [email protected]

like image 7
Saeed Shahrabi Avatar answered Nov 01 '22 11:11

Saeed Shahrabi