Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] [TS Migration] migrate KeyboardAvoidingView.js to TypeScript #29955

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do YOu use these variables? behavior, contentContainerStyle, enabled, keyboardVerticalOffset

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