-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29757 from software-mansion-labs/ts-migration/For…
…mScrollView [No QA] [TS migration] Migrate 'FormScrollView.js' component to TypeScript
- Loading branch information
Showing
2 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |