1. Create new app
npx create-react-app myapp
2. Edit workspace settings in vscode for flow typechecking
{
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
}
Make sure you have flow addon installed (called flowtype.flow-for-vscode)
3.Install flow to your project
If you use create-reat-app, here is a guide for this step.
yarn add -D flow-bin
yarn run flow init
4. Install jest flow types
Find version of jest
npx jest -v
Install typings for jest, e.g.
npx flow-typed install jest@22
5. Register flow-typed in config
In your .flowconfig
, add flow-typed to libs section.
...
[libs]
flow-typed
...