Skip to content

Commit

Permalink
Tell template app .flowconfig to look for .native.js files
Browse files Browse the repository at this point in the history
Summary:
`metro-bundler` looks for `.native.js` files ([see here](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js#L458)). Packages such as `react-navigation` rely on this functionality ([see here](https://github.com/react-community/react-navigation/blob/master/src/PlatformHelpers.native.js)). This PR makes it so you can `react-native init`, `yarn add react-navigation`, and `flow` successfully!

1. `react-native init`
2. `yarn add react-navigation`
3. `flow`

[CLI] [MINOR] [Flow] - Tell template app .flowconfig to look for .native.js files
Closes #16816

Differential Revision: D6445363

Pulled By: shergin

fbshipit-source-id: c0ce7ed27a8a3291deaa09d98e822362f93929c8
  • Loading branch information
Ashoat authored and facebook-github-bot committed Nov 30, 2017
1 parent d674d48 commit 343c5a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions local-cli/templates/HelloWorld/_flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
Expand Down

0 comments on commit 343c5a9

Please sign in to comment.