Skip to content

Commit 7528636

Browse files
yungstersfacebook-github-bot
authored andcommittedMay 13, 2018
RN: Fix Type for ReactNative.NativeComponent (2/2)
Reviewed By: TheSavior Differential Revision: D7984936 fbshipit-source-id: d0477c54420b49220e9529fa70c2b2babce0b409
1 parent de11ba2 commit 7528636

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed
 

‎Libraries/Components/Keyboard/KeyboardAvoidingView.js

+4
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ const KeyboardAvoidingView = ((createReactClass({
189189
heightStyle = {height: this.frame.height - bottomHeight, flex: 0};
190190
}
191191
return (
192+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
192193
<View
193194
ref={viewRef}
194195
style={[style, heightStyle]}
@@ -203,6 +204,7 @@ const KeyboardAvoidingView = ((createReactClass({
203204
const {contentContainerStyle} = this.props;
204205

205206
return (
207+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
206208
<View
207209
ref={viewRef}
208210
style={style}
@@ -217,6 +219,7 @@ const KeyboardAvoidingView = ((createReactClass({
217219
case 'padding':
218220
const paddingStyle = {paddingBottom: bottomHeight};
219221
return (
222+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
220223
<View
221224
ref={viewRef}
222225
style={[style, paddingStyle]}
@@ -228,6 +231,7 @@ const KeyboardAvoidingView = ((createReactClass({
228231

229232
default:
230233
return (
234+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
231235
<View
232236
ref={viewRef}
233237
onLayout={this._onLayout}

‎Libraries/Lists/VirtualizedList.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
757757
cellKey={this._getCellKey() + '-header'}
758758
key="$header">
759759
<View onLayout={this._onLayoutHeader} style={inversionStyle}>
760-
{element}
760+
{
761+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
762+
element}
761763
</View>
762764
</VirtualizedCellWrapper>,
763765
);
@@ -890,7 +892,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
890892
cellKey={this._getCellKey() + '-footer'}
891893
key="$footer">
892894
<View onLayout={this._onLayoutFooter} style={inversionStyle}>
893-
{element}
895+
{
896+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
897+
element}
894898
</View>
895899
</VirtualizedCellWrapper>,
896900
);
@@ -1008,6 +1012,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10081012
_defaultRenderScrollComponent = props => {
10091013
const onRefresh = props.onRefresh;
10101014
if (this._isNestedWithSameOrientation()) {
1015+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
10111016
return <View {...props} />;
10121017
} else if (onRefresh) {
10131018
invariant(

‎Libraries/RCTTest/SnapshotViewIOS.ios.js

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class SnapshotViewIOS extends React.Component<{
4242
const testIdentifier = this.props.testIdentifier || 'test';
4343
const onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction;
4444
return (
45+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
4546
<RCTSnapshot
4647
style={style.snapshot}
4748
{...this.props}

‎Libraries/ReactNative/AppContainer.js

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class AppContainer extends React.Component<Props, State> {
102102
pointerEvents="box-none"
103103
style={styles.appContainer}
104104
ref={ref => {
105+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
105106
this._mainRef = ref;
106107
}}>
107108
{this.props.children}

‎Libraries/Text/Text.js

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type ResponseHandlers = $ReadOnly<{|
3636

3737
type Props = $ReadOnly<{
3838
...TextProps,
39+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
3940
forwardedRef: ?React.Ref<NativeComponent<TextProps>>,
4041
}>;
4142

@@ -139,6 +140,7 @@ class TouchableText extends React.Component<Props, State> {
139140
<TextAncestor.Consumer>
140141
{hasTextAncestor =>
141142
hasTextAncestor ? (
143+
// $FlowFixMe - Typing ReactNativeComponent revealed errors
142144
<RCTVirtualText {...props} ref={props.forwardedRef} />
143145
) : (
144146
<TextAncestor.Provider value={true}>

‎RNTester/js/RTLExample.js

+1
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ class RTLExample extends React.Component<any, State> {
484484
<RNTesterBlock
485485
title={'Controlling Animation'}
486486
description={'Animation direction according to layout'}>
487+
{/* $FlowFixMe - Typing ReactNativeComponent revealed errors */}
487488
<View Style={styles.view}>
488489
<AnimationBlock
489490
onPress={this._linearTap}

0 commit comments

Comments
 (0)
Please sign in to comment.