We don't need react-static-container dependency.
You can require StaticContainer directly like this:
const StaticContainer = require('react-native/Libraries/Components/StaticContainer');
It is used in:
https://github.com/aksonov/react-native-router-flux/blob/b11a84962e4e4d9265770382b8859d21d1a12ea0/src/TabbedView.js#L3
I get an error on react-native run-android because of this unresolved dependency
Transforming modules 鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒 97.6% (486/492)...(node:
11676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection
id: 886): UnableToResolveError: Unable to resolve module ./lib/StaticContainer.
react from C:\projects\manager\node_modules\react-static-container\index.js:
Directory C:\projects\manager\node_modulesreact-static-container\lib\StaticCont
ainer.react doesn't exist
Above Fix works btw
This didn't work for me using Node v7.8.0, I think because all the node_modules are in the root folder rather than individually installed per dependency in its own node_modules folder.
I just added StaticContainer as an import from react-native on the line above
import { View, StyleSheet, StaticContainer } from 'react-native';
@ablankenship10 Unfortunatly didn't work for me. I changed the import and removed the react-stactic-container package, but I still have the error.
Not only is the "react-static-container" dependency not needed -- for me it's causing problems, when running the react-native packager (ie. "react-native start"), with watchman installed:
Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: StaticContainer.react
Paths: C:/Root/Apps/@V/LucidLink/Main\node_modules/react-static-container/lib/StaticContainer.react.js collides with C:\Root\Apps\@V\LucidLink\Main\node_modules\react-native\Libraries\Components\StaticContainer.js
This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
Duplicate module name: StaticContainer.react
Paths: C:/Root/Apps/@V/LucidLink/Main\node_modules/react-static-container/lib/StaticContainer.react.js collides with C:\Root\Apps\@V\LucidLink\Main\node_modules\react-native\Libraries\Components\StaticContainer.js
This error is caused by a @providesModule declaration with the same name across two different files.
at HasteMap._updateHasteMap (C:/Root/Apps/@V/LucidLink/Main/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
at module.getName.then.name (C:/Root/Apps/@V/LucidLink/Main/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:119:31)
I deleted the "react-static-container" folder, and that fixed it. However, when I installed the latest version of react-native-router-flux, it reinstalled the react-static-container folder as a dependency.
So having the react-native-router-flux package instead just use the version present in react-native itself (react-native\Libraries\ComponentsStaticContainer.js) would be helpful.