Skip to content

Commit

Permalink
Merge pull request #29955 from JKobrynski/migrateKeyboardAvoidingView…
Browse files Browse the repository at this point in the history
…ToTypeScript

[No QA] [TS Migration] migrate KeyboardAvoidingView.js to TypeScript
  • Loading branch information
lakchote authored Oct 31, 2023
2 parents deb267f + 3ccdf03 commit a31933a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/
import React from 'react';
import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native';
import KeyboardAvoidingViewProps from './types';

function KeyboardAvoidingView(props) {
function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) {
// eslint-disable-next-line react/jsx-props-no-spreading
return <KeyboardAvoidingViewComponent {...props} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*/
import React from 'react';
import {View} from 'react-native';
import _ from 'underscore';
import KeyboardAvoidingViewProps from './types';

function KeyboardAvoidingView(props) {
const viewProps = _.omit(props, ['behavior', 'contentContainerStyle', 'enabled', 'keyboardVerticalOffset']);
function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) {
const {behavior, contentContainerStyle, enabled, keyboardVerticalOffset, ...rest} = props;
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<View {...viewProps} />
<View {...rest} />
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/KeyboardAvoidingView/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {KeyboardAvoidingViewProps} from 'react-native';

export default KeyboardAvoidingViewProps;

0 comments on commit a31933a

Please sign in to comment.