Skip to content

Commit

Permalink
Fix React Native open source
Browse files Browse the repository at this point in the history
Reviewed By: hramos, TheSavior

Differential Revision: D5728356

fbshipit-source-id: fb751d67c16ba9273de93d9b6d5acd65b1555dca
  • Loading branch information
Caleb Meredith authored and facebook-github-bot committed Aug 29, 2017
1 parent 2d0fe10 commit 63f9901
Show file tree
Hide file tree
Showing 27 changed files with 257 additions and 300 deletions.
7 changes: 3 additions & 4 deletions IntegrationTests/IntegrationTestsApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ class IntegrationTestsApp extends React.Component<{}, $FlowFixMeState> {
if (this.state.test) {
return (
<ScrollView>
{/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses
* an error when upgrading Flow's support for React. Common errors
* found when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */}
{/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */}
<this.state.test />
</ScrollView>
);
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Animated/src/AnimatedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ class AnimatedEvent {
recMapping.setValue(recEvt);
} else if (typeof recMapping === 'object') {
for (const mappingKey in recMapping) {
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.53 was deployed. To see
* the error delete this comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */
traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Components/ActivityIndicator/ActivityIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ type DefaultProps = {
/**
* Displays a circular loading indicator.
*/
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an error
* found when Flow v0.53 was deployed. To see the error delete this comment and
* run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const ActivityIndicator = createReactClass({
displayName: 'ActivityIndicator',
mixins: [NativeMethodsMixin],
Expand Down
7 changes: 3 additions & 4 deletions Libraries/Components/CheckBox/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ let CheckBox = createReactClass({
<RCTCheckBox
{...props}
ref={ref => {
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */
this._rctCheckBox = ref;
}}
onChange={this._onChange}
Expand Down
95 changes: 46 additions & 49 deletions Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ const ScrollView = createReactClass({
},

_getKeyForIndex: function(index, childArray) {
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const child = childArray[index];
return child && child.key;
},
Expand Down Expand Up @@ -580,9 +580,9 @@ const ScrollView = createReactClass({
if (!this.props.stickyHeaderIndices) {
return;
}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const childArray = React.Children.toArray(this.props.children);
if (key !== this._getKeyForIndex(index, childArray)) {
// ignore stale layout update
Expand All @@ -592,13 +592,13 @@ const ScrollView = createReactClass({
const layoutY = event.nativeEvent.layout.y;
this._headerLayoutYs.set(key, layoutY);

/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const indexOfIndex = this.props.stickyHeaderIndices.indexOf(index);
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const previousHeaderIndex = this.props.stickyHeaderIndices[indexOfIndex - 1];
if (previousHeaderIndex != null) {
const previousHeader = this._stickyHeaderRefs.get(
Expand Down Expand Up @@ -697,33 +697,34 @@ const ScrollView = createReactClass({

const {stickyHeaderIndices} = this.props;
const hasStickyHeaders = stickyHeaderIndices && stickyHeaderIndices.length > 0;
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
const childArray = hasStickyHeaders && React.Children.toArray(this.props.children);
const children = hasStickyHeaders ?
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
childArray.map((child, index) => {
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete
* this comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
const indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1;
if (indexOfIndex > -1) {
const key = child.key;
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.53 was deployed. To see the error
* delete this comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */
const nextIndex = stickyHeaderIndices[indexOfIndex + 1];
return (
<ScrollViewStickyHeader
key={key}
ref={(ref) => this._setStickyHeaderRef(key, ref)}
nextHeaderLayoutY={
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.53 was deployed. To
* see the error delete this comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss)
* This comment suppresses an error when upgrading Flow's
* support for React. To see the error delete this comment and
* run Flow. */
this._headerLayoutYs.get(this._getKeyForIndex(nextIndex, childArray))
}
onLayout={(event) => this._onStickyHeaderLayout(index, event, key)}
Expand All @@ -735,17 +736,16 @@ const ScrollView = createReactClass({
return child;
}
}) :
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
this.props.children;
const contentContainer =
<ScrollContentContainerViewClass
{...contentSizeChangeProps}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
ref={this._setInnerViewRef}
style={contentContainerStyle}
removeClippedSubviews={
Expand Down Expand Up @@ -786,9 +786,9 @@ const ScrollView = createReactClass({
onResponderGrant: this.scrollResponderHandleResponderGrant,
onResponderReject: this.scrollResponderHandleResponderReject,
onResponderRelease: this.scrollResponderHandleResponderRelease,
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
onResponderTerminate: this.scrollResponderHandleTerminate,
onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,
onScroll: this._handleScroll,
Expand Down Expand Up @@ -818,10 +818,9 @@ const ScrollView = createReactClass({
// On iOS the RefreshControl is a child of the ScrollView.
// tvOS lacks native support for RefreshControl, so don't include it in that case
return (
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses
* an error when upgrading Flow's support for React. Common errors
* found when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
{Platform.isTVOS ? null : refreshControl}
{contentContainer}
Expand All @@ -837,21 +836,19 @@ const ScrollView = createReactClass({
return React.cloneElement(
refreshControl,
{style: props.style},
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses
* an error when upgrading Flow's support for React. Common errors
* found when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */
<ScrollViewClass {...props} style={baseStyle} ref={this._setScrollViewRef}>
{contentContainer}
</ScrollViewClass>
);
}
}
return (
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
{contentContainer}
</ScrollViewClass>
Expand Down
13 changes: 6 additions & 7 deletions Libraries/Components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ var Switch = createReactClass({
this._rctSwitch.setNativeProps({value: this.props.value});
}
//Change the props after the native props are set in case the props change removes the component
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
this.props.onChange && this.props.onChange(event);
this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value);
},
Expand All @@ -115,10 +115,9 @@ var Switch = createReactClass({
return (
<RCTSwitch
{...props}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
ref={(ref) => { this._rctSwitch = ref; }}
onChange={this._onChange}
/>
Expand Down
12 changes: 6 additions & 6 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ const TextInput = createReactClass({
}
props.autoCapitalize =
UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
var children = this.props.children;
var childCount = 0;
React.Children.forEach(children, () => ++childCount);
Expand Down Expand Up @@ -897,9 +897,9 @@ const TextInput = createReactClass({
},

_onTextInput: function(event: Event) {
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.53 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error when upgrading Flow's support for React. To see the
* error delete this comment and run Flow. */
this.props.onTextInput && this.props.onTextInput(event);
},

Expand Down
42 changes: 18 additions & 24 deletions Libraries/Components/Touchable/TouchableBounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,36 +139,30 @@ var TouchableBounce = createReactClass({
render: function(): React.Element<any> {
return (
<Animated.View
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
style={[{transform: [{scale: this.state.scale}]}, this.props.style]}
accessible={this.props.accessible !== false}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
accessibilityLabel={this.props.accessibilityLabel}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
accessibilityComponentType={this.props.accessibilityComponentType}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
accessibilityTraits={this.props.accessibilityTraits}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
nativeID={this.props.nativeID}
/* $FlowFixMe(>=0.53.0 site=react_native_fb) This comment suppresses an
* error when upgrading Flow's support for React. Common errors found
* when upgrading Flow's React support are documented at
* https://fburl.com/eq7bs81w */
/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for React.
* To see the error delete this comment and run Flow. */
testID={this.props.testID}
hitSlop={this.props.hitSlop}
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
Expand Down
Loading

0 comments on commit 63f9901

Please sign in to comment.