I created a monorepo which will contain 2 apps created with create-react-app and 1 module with shared components. Right now I have 1 create-react-app and the shared component module.
For my project I would like to use Flow. Thus I used flow init in the root of my project. Running yarn start works fine with using flow types inside the create-react-app files. But I am importing one file from the shared components with the following content:
export class Decision {
mainTopic: string;
constructor(mainTopic, options) {
this.mainTopic = 1;
this.options = 1;
}
}
For this file I get the following error:
SyntaxError: /packages/shared_components/model/Decision.js: Unexpected token (2:13)
Removing the type annotations lets the app compile. What do I have to change to get the flow types inside the shared components module working?
Thanks in advance!