Cannot re-export a type when using the --isolatedModules with TS 3.2.2

前端 未结 2 878
囚心锁ツ
囚心锁ツ 2021-01-11 10:38

I probably need to rethink the way we structure our React components. We are using the latest react-scripts that allow Typescript to be used and by default, the isolat

2条回答
  •  独厮守ぢ
    2021-01-11 11:23

    I am using the same structure personally and stumbled into the same issue after moving to a create-react-app boilerplate which enforces isolatedModules. A workaround that seems to be working in stark contrast to the idea behind isolatedModules is to use export * from "./Component"; in index.ts.

提交回复
热议问题