Permalink
Browse files

Flow Type KeyboardAvoidingView

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 188b118b6075be1614c553596b85d430767f2dbc
Showing with 12 additions and 3 deletions.
  1. +12 −3 Libraries/Components/Keyboard/KeyboardAvoidingView.js
@@ -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,
@@ -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],
@@ -229,6 +238,6 @@ const KeyboardAvoidingView = createReactClass({
);
}
},
});
}): any): React.ComponentType<Props>);
module.exports = KeyboardAvoidingView;

0 comments on commit 188b118

Please sign in to comment.