Skip to content

Commit

Permalink
Merge pull request #29757 from software-mansion-labs/ts-migration/For…
Browse files Browse the repository at this point in the history
…mScrollView

[No QA] [TS migration] Migrate 'FormScrollView.js' component to TypeScript
  • Loading branch information
nkuoch authored Oct 26, 2023
2 parents a75baa1 + 9b76129 commit b644611
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/components/FormScrollView.js

This file was deleted.

27 changes: 27 additions & 0 deletions src/components/FormScrollView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, {ForwardedRef} from 'react';
import {ScrollView, ScrollViewProps} from 'react-native';
import styles from '../styles/styles';

type FormScrollViewProps = ScrollViewProps & {
/** Form elements */
children: React.ReactNode;
};

function FormScrollView({children, ...rest}: FormScrollViewProps, ref: ForwardedRef<ScrollView>) {
return (
<ScrollView
style={[styles.w100, styles.flex1]}
ref={ref}
contentContainerStyle={styles.flexGrow1}
keyboardShouldPersistTaps="handled"
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
</ScrollView>
);
}

FormScrollView.displayName = 'FormScrollView';

export default React.forwardRef(FormScrollView);

0 comments on commit b644611

Please sign in to comment.