Add a working RN build

This commit is contained in:
Dan Abramov committed 2017-03-16 19:10:46 +00:00
1 parent 04972cde8e
commit e4fcbecc1e
7 files changed
+85 -8

No files matched your search

+9 -1
View File
@@ -11,7 +11,6 @@
*/
'use strict';
var ReactNative = require('ReactNative');
var ReactNativeAttributePayload = require('ReactNativeAttributePayload');
var TextInputState = require('TextInputState');
var UIManager = require('UIManager');
@@ -41,6 +40,12 @@ type MeasureLayoutOnSuccessCallback = (
height: number,
) => void;
var ReactNative;
function injectReactNative(RN) {
ReactNative = RN;
}
function warnForStyleProps(props, validAttributes) {
for (var key in validAttributes.style) {
if (!(validAttributes[key] || props[key] === undefined)) {
@@ -174,6 +179,9 @@ var NativeMethodsMixin = {
blur: function() {
TextInputState.blurTextInput(ReactNative.findNodeHandle(this));
},
// Temporary hack to avoid a circular dependency
__injectReactNative: injectReactNative,
};
function throwOnStylesProp(component, props) {
+12
View File
@@ -11,12 +11,24 @@
'use strict';
var ReactNativeStack = require('ReactNativeStack');
var NativeMethodsMixin = require('NativeMethodsMixin');
// TODO (bvaughn) Enable Fiber experiement via ReactNativeFeatureFlags
var ReactNative = ReactNativeStack;
// TODO: unroll the circular dependency
NativeMethodsMixin.__injectReactNative(ReactNative);
ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
createReactNativeComponentClass: require('createReactNativeComponentClass'),
findNodeHandle: require('findNodeHandle'),
NativeMethodsMixin: require('NativeMethodsMixin'),
ReactDebugTool: require('ReactDebugTool'),
ReactErrorUtils: require('ReactErrorUtils'),
ReactNativeComponentTree: require('ReactNativeComponentTree'),
ReactNativePropRegistry: require('ReactNativePropRegistry'),
ReactPerf: require('ReactPerf'),
TouchHistoryMath: require('TouchHistoryMath'),
};
module.exports = ReactNative;