Flow type checker with React: Stripping Flow Syntax from the Compiled Code

Stripping Flow Syntax from the Compiled Code

If your project was set up using Create React App, congratulations! The Flow annotations are already being stripped by default so you don’t need to do anything else in this step.

If you manually configured Babel for your project, you will need to install a special preset for Flow: run 'yarn add --dev babel-preset-flow' for yarn or 'npm install --save-dev babel-preset-flow' for npm. Then add the flow preset to your Babel configuration. For example, if you configure Babel through .babelrc file, it could look like this: { "presets": [ "flow", "react" ] }.

Related concepts

Stripping Flow Syntax from the Compiled Code

Flow type checker with React: Stripping Flow Syntax from the Compiled Code — Structure map

Clickable & Draggable!

Flow type checker with React: Stripping Flow Syntax from the Compiled Code — Related pages: