Updated babel installation instructions for Flow (#2248)

updated how to install babel presets to use the newer namespace conventions that comes with newer versions of Babel, version 7.
My react app kept crashing when I tried installing Flow.
I have updated the docs on Flow's documentation, then I saw the same issue here.

Here is the PR on Flow's docs just in case - https://github.com/facebook/flow/pull/7856
This commit is contained in:
Victor Akerele
2019-08-15 17:48:51 +01:00
committed by Alex Krolick
parent 78270c581d
commit 0006b39438

View File

@@ -88,13 +88,13 @@ If you manually configured Babel for your project, you will need to install a sp
If you use Yarn, run:
```bash
yarn add --dev babel-preset-flow
yarn add --dev @babel/preset-flow
```
If you use npm, run:
```bash
npm install --save-dev babel-preset-flow
npm install --save-dev @babel/preset-flow
```
Then add the `flow` preset to your [Babel configuration](https://babeljs.io/docs/usage/babelrc/). For example, if you configure Babel through `.babelrc` file, it could look like this:
@@ -102,7 +102,7 @@ Then add the `flow` preset to your [Babel configuration](https://babeljs.io/docs
```js{3}
{
"presets": [
"flow",
"@babel/preset-flow",
"react"
]
}