Skip to content

Commit

Permalink
RN: Fix Type for ReactNative.NativeComponent (2/2)
Browse files Browse the repository at this point in the history
Reviewed By: TheSavior

Differential Revision: D7984936

fbshipit-source-id: d0477c54420b49220e9529fa70c2b2babce0b409
  • Loading branch information
yungsters authored and facebook-github-bot committed May 13, 2018
1 parent de11ba2 commit 7528636
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ const KeyboardAvoidingView = ((createReactClass({
heightStyle = {height: this.frame.height - bottomHeight, flex: 0};
}
return (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<View
ref={viewRef}
style={[style, heightStyle]}
Expand All @@ -203,6 +204,7 @@ const KeyboardAvoidingView = ((createReactClass({
const {contentContainerStyle} = this.props;

return (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<View
ref={viewRef}
style={style}
Expand All @@ -217,6 +219,7 @@ const KeyboardAvoidingView = ((createReactClass({
case 'padding':
const paddingStyle = {paddingBottom: bottomHeight};
return (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<View
ref={viewRef}
style={[style, paddingStyle]}
Expand All @@ -228,6 +231,7 @@ const KeyboardAvoidingView = ((createReactClass({

default:
return (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<View
ref={viewRef}
onLayout={this._onLayout}
Expand Down
9 changes: 7 additions & 2 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
cellKey={this._getCellKey() + '-header'}
key="$header">
<View onLayout={this._onLayoutHeader} style={inversionStyle}>
{element}
{
// $FlowFixMe - Typing ReactNativeComponent revealed errors
element}
</View>
</VirtualizedCellWrapper>,
);
Expand Down Expand Up @@ -890,7 +892,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
cellKey={this._getCellKey() + '-footer'}
key="$footer">
<View onLayout={this._onLayoutFooter} style={inversionStyle}>
{element}
{
// $FlowFixMe - Typing ReactNativeComponent revealed errors
element}
</View>
</VirtualizedCellWrapper>,
);
Expand Down Expand Up @@ -1008,6 +1012,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
_defaultRenderScrollComponent = props => {
const onRefresh = props.onRefresh;
if (this._isNestedWithSameOrientation()) {
// $FlowFixMe - Typing ReactNativeComponent revealed errors
return <View {...props} />;
} else if (onRefresh) {
invariant(
Expand Down
1 change: 1 addition & 0 deletions Libraries/RCTTest/SnapshotViewIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SnapshotViewIOS extends React.Component<{
const testIdentifier = this.props.testIdentifier || 'test';
const onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction;
return (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<RCTSnapshot
style={style.snapshot}
{...this.props}
Expand Down
1 change: 1 addition & 0 deletions Libraries/ReactNative/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class AppContainer extends React.Component<Props, State> {
pointerEvents="box-none"
style={styles.appContainer}
ref={ref => {
// $FlowFixMe - Typing ReactNativeComponent revealed errors
this._mainRef = ref;
}}>
{this.props.children}
Expand Down
2 changes: 2 additions & 0 deletions Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type ResponseHandlers = $ReadOnly<{|

type Props = $ReadOnly<{
...TextProps,
// $FlowFixMe - Typing ReactNativeComponent revealed errors
forwardedRef: ?React.Ref<NativeComponent<TextProps>>,
}>;

Expand Down Expand Up @@ -139,6 +140,7 @@ class TouchableText extends React.Component<Props, State> {
<TextAncestor.Consumer>
{hasTextAncestor =>
hasTextAncestor ? (
// $FlowFixMe - Typing ReactNativeComponent revealed errors
<RCTVirtualText {...props} ref={props.forwardedRef} />
) : (
<TextAncestor.Provider value={true}>
Expand Down
1 change: 1 addition & 0 deletions RNTester/js/RTLExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ class RTLExample extends React.Component<any, State> {
<RNTesterBlock
title={'Controlling Animation'}
description={'Animation direction according to layout'}>
{/* $FlowFixMe - Typing ReactNativeComponent revealed errors */}
<View Style={styles.view}>
<AnimationBlock
onPress={this._linearTap}
Expand Down

0 comments on commit 7528636

Please sign in to comment.