Flow Type KeyboardAvoidingView

Reviewed By: yungsters

Differential Revision: D7978494

fbshipit-source-id: e21b4910470d3dc3fd35027f2f975b6842baa6ab
This commit is contained in:
Eli White 2018-05-12 10:25:16 -07:00 коммит произвёл Facebook Github Bot
Родитель 97e572ea6d
Коммит 188b118b60
1 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -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;