diff --git a/src/components/FormScrollView.js b/src/components/FormScrollView.js deleted file mode 100644 index b52c8d00c51a..000000000000 --- a/src/components/FormScrollView.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import {ScrollView} from 'react-native'; -import styles from '../styles/styles'; - -const propTypes = { - /** Form elements */ - children: PropTypes.node.isRequired, -}; - -const FormScrollViewWithRef = React.forwardRef((props, ref) => ( - - {props.children} - -)); - -FormScrollViewWithRef.displayName = 'FormScrollViewWithRef'; -FormScrollViewWithRef.propTypes = propTypes; -export default FormScrollViewWithRef; diff --git a/src/components/FormScrollView.tsx b/src/components/FormScrollView.tsx new file mode 100644 index 000000000000..b6c1062b5e4e --- /dev/null +++ b/src/components/FormScrollView.tsx @@ -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) { + return ( + + {children} + + ); +} + +FormScrollView.displayName = 'FormScrollView'; + +export default React.forwardRef(FormScrollView);