From 0a88663b1e1d41fba92d640b9c0b573e875a1d8b Mon Sep 17 00:00:00 2001 From: Marshall Roch Date: Sun, 22 Mar 2015 22:30:06 -0700 Subject: [PATCH] Work around flow bug with exports --- Libraries/react-native/react-native.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index a79bde05f75977..4642c5b9b43510 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -5,9 +5,14 @@ */ 'use strict'; -var ReactNative = { - ...require('React'), - +// Export React, plus some native additions. +// +// The use of Object.create/assign is to work around a Flow bug (#6560135). +// Once that is fixed, change this back to +// +// var ReactNative = {...require('React'), /* additions */} +// +var ReactNative = Object.assign(Object.create(require('React')), { // Components ActivityIndicatorIOS: require('ActivityIndicatorIOS'), DatePickerIOS: require('DatePickerIOS'), @@ -54,7 +59,7 @@ var ReactNative = { cloneWithProps: require('cloneWithProps'), update: require('update'), }, -}; +}); if (__DEV__) { ReactNative.addons.Perf = require('ReactDefaultPerf');