Skip to content

Commit

Permalink
Fix react-native.js.flow
Browse files Browse the repository at this point in the history
Summary:We no longer forward React onto this object. We only forward the ReactNative
module onto it.

We also deprecated the addons so they'll all warn. We'll remove it
completely soon.
Closes facebook#7136

Reviewed By: gabelevi

Differential Revision: D3211809

Pulled By: sebmarkbage

fb-gh-sync-id: 77aaa909dca5e2522cfaa7b4ca361fabc614be58
fbshipit-source-id: 77aaa909dca5e2522cfaa7b4ca361fabc614be58
  • Loading branch information
sebmarkbage authored and Facebook Github Bot 5 committed Apr 23, 2016
1 parent 862136a commit 248879f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
3 changes: 0 additions & 3 deletions Examples/Movies/MovieCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ var MovieCell = React.createClass({
onShowUnderlay={this.props.onHighlight}
onHideUnderlay={this.props.onUnhighlight}>
<View style={styles.row}>
{/* $FlowIssue #7363964 - There's a bug in Flow where you cannot
* omit a property or set it to undefined if it's inside a shape,
* even if it isn't required */}
<Image
source={getImageSource(this.props.movie, 'det')}
style={styles.cellImage}
Expand Down
3 changes: 0 additions & 3 deletions Examples/Movies/MovieScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ var MovieScreen = React.createClass({
return (
<ScrollView contentContainerStyle={styles.contentContainer}>
<View style={styles.mainSection}>
{/* $FlowIssue #7363964 - There's a bug in Flow where you cannot
* omit a property or set it to undefined if it's inside a shape,
* even if it isn't required */}
<Image
source={getImageSource(this.props.movie, 'det')}
style={styles.detailsImage}
Expand Down
21 changes: 2 additions & 19 deletions Libraries/react-native/react-native.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/
'use strict';

// Export React, plus some native additions.
// Export ReactNative, 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')), {
var ReactNative = Object.assign(Object.create(require('ReactNative')), {
// Components
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
ART: require('ReactNativeART'),
Expand Down Expand Up @@ -114,23 +114,6 @@ var ReactNative = Object.assign(Object.create(require('react')), {
ColorPropType: require('ColorPropType'),
EdgeInsetsPropType: require('EdgeInsetsPropType'),
PointPropType: require('PointPropType'),

// See http://facebook.github.io/react/docs/addons.html
addons: {
LinkedStateMixin: require('LinkedStateMixin'),
Perf: undefined,
PureRenderMixin: require('ReactComponentWithPureRenderMixin'),
TestModule: require('NativeModules').TestModule,
TestUtils: undefined,
batchedUpdates: require('ReactUpdates').batchedUpdates,
createFragment: require('ReactFragment').create,
update: require('update'),
},
});

if (__DEV__) {
ReactNative.addons.Perf = require('ReactDefaultPerf');
ReactNative.addons.TestUtils = require('ReactTestUtils');
}

module.exports = ReactNative;

0 comments on commit 248879f

Please sign in to comment.