I'm trying to use react-bootstrap
with 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';
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
I tried this code and it was fixed
npm i [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With