diff --git a/packager/react-packager/src/Resolver/index.js b/packager/react-packager/src/Resolver/index.js index 5b9e890241b0a6..6b58f99eee2dd5 100644 --- a/packager/react-packager/src/Resolver/index.js +++ b/packager/react-packager/src/Resolver/index.js @@ -85,14 +85,21 @@ class Resolver { (opts.blacklistRE && opts.blacklistRE.test(filepath)); }, providesModuleNodeModules: [ - 'fbjs', - 'react', - 'react-native', + // Use the project's installed version of react-native + // as the "haste" version of `react-native` + // (and ignore any nested copies); + { name: 'react-native', parent: null }, + // Use the react peerDep for the "haste" + // version of `react`. + { name: 'react', parent: null }, + // We only want to use the fbjs underneath react-native + // as the "haste" version of `fbjs`. + { name: 'fbjs', parent: 'react-native' }, // Parse requires AsyncStorage. They will // change that to require('react-native') which // should work after this release and we can // remove it from here. - 'parse', + { name: 'parse', parent: null }, ], platforms: ['ios', 'android'], preferNativePlatform: true,