Skip to content

Commit

Permalink
Work around flow bug with exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mroch committed Mar 23, 2015
1 parent b612741 commit 0a88663
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Libraries/react-native/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -54,7 +59,7 @@ var ReactNative = {
cloneWithProps: require('cloneWithProps'),
update: require('update'),
},
};
});

if (__DEV__) {
ReactNative.addons.Perf = require('ReactDefaultPerf');
Expand Down

0 comments on commit 0a88663

Please sign in to comment.