Closed amasad closed 9 years ago
It seems that the 0.7's updated packager also completely changes how requires should be done.
I started some of this work at https://github.com/mnylen/react-native-icons/tree/0.7-support . Hopefully it helps a bit.
Yes, good catch. We actually never intended that our non-standard internal module system leak out into the community. It works ok for the company but won't work in the wild; mainly because it's single global namespace. Going forward we want to use node modules standard.
Why is this closed? AFAICT, this is still a problem in the code:
FAKIconImage.ios.js:
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes');
var ImageResizeMode = require('ImageResizeMode');
var ImageStylePropTypes = require('ImageStylePropTypes');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
Am I missing something?
@jeffreywescott Some of them were fixed and I had closed it incorrectly. Will re-open now. Some of the modules aren't exposed so will have to sort out what to do with those. If you have any thoughts or want to do a PR let me know.
See: #71. It's not perfect, but at least things are running in my project on react-native 0.8.0.
react-native uses a module format that is specific to Facebook that relies on a global namespace. We're trying to isolate it from the outside world and use the standard CommonJS and node modules instead. Therefore in the latest react-native version 0.7.0-rc.2 requiring any of the internal modules using their name will be warning and in the future will be an error.
For example
require('NativeModules')
is now a warning:To depend on NativeModules please use the exported react-native node module:
This issue was originally reported here: https://github.com/facebook/react-native/issues/1808