From db7f9702103780dbacfa131d6915b8c99148ae81 Mon Sep 17 00:00:00 2001 From: ashoat Date: Wed, 29 Nov 2017 21:53:45 -0800 Subject: [PATCH] Tell template app .flowconfig to look for .native.js files 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 https://github.com/facebook/react-native/pull/16816 Differential Revision: D6445363 Pulled By: shergin fbshipit-source-id: c0ce7ed27a8a3291deaa09d98e822362f93929c8 --- local-cli/templates/HelloWorld/_flowconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 3cec7c629be4db..457423de0b20ea 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -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