Skip to content

Commit

Permalink
Flow Type KeyboardAvoidingView
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7978494

fbshipit-source-id: e21b4910470d3dc3fd35027f2f975b6842baa6ab
  • Loading branch information
TheSavior authored and facebook-github-bot committed May 12, 2018
1 parent 97e572e commit 188b118
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const View = require('View');
const ViewPropTypes = require('ViewPropTypes');

import type EmitterSubscription from 'EmitterSubscription';
import type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';
import type {ViewStyleProp} from 'StyleSheet';
import type {ViewProps, ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';

type ScreenRect = {
screenX: number,
Expand All @@ -39,13 +40,21 @@ type KeyboardChangeEvent = {
easing?: string,
};

type Props = $ReadOnly<{|
...ViewProps,
behavior?: ?('height' | 'position' | 'padding'),
contentContainerStyle?: ?ViewStyleProp,
enabled?: ?boolean,
keyboardVerticalOffset?: ?number,
|}>;

const viewRef = 'VIEW';

/**
* This is a component to solve the common problem of views that need to move out of the way of the virtual keyboard.
* It can automatically adjust either its height, position or bottom padding based on the position of the keyboard.
*/
const KeyboardAvoidingView = createReactClass({
const KeyboardAvoidingView = ((createReactClass({
displayName: 'KeyboardAvoidingView',
mixins: [TimerMixin],

Expand Down Expand Up @@ -229,6 +238,6 @@ const KeyboardAvoidingView = createReactClass({
);
}
},
});
}): any): React.ComponentType<Props>);

module.exports = KeyboardAvoidingView;

0 comments on commit 188b118

Please sign in to comment.