diff --git a/src/components/InlineErrorText.js b/src/components/InlineErrorText.js deleted file mode 100644 index ea701a3f6e8e..000000000000 --- a/src/components/InlineErrorText.js +++ /dev/null @@ -1,31 +0,0 @@ -import _ from 'underscore'; -import React from 'react'; -import PropTypes from 'prop-types'; -import styles from '../styles/styles'; -import Text from './Text'; - -const propTypes = { - /** Text to display */ - children: PropTypes.string.isRequired, - - /** Styling for inline error text */ - // eslint-disable-next-line react/forbid-prop-types - styles: PropTypes.arrayOf(PropTypes.object), -}; - -const defaultProps = { - styles: [], -}; - -function InlineErrorText(props) { - if (_.isEmpty(props.children)) { - return null; - } - - return {props.children}; -} - -InlineErrorText.propTypes = propTypes; -InlineErrorText.defaultProps = defaultProps; -InlineErrorText.displayName = 'InlineErrorText'; -export default InlineErrorText; diff --git a/src/components/InlineErrorText.tsx b/src/components/InlineErrorText.tsx new file mode 100644 index 000000000000..109acfc1b893 --- /dev/null +++ b/src/components/InlineErrorText.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import {TextStyle} from 'react-native'; +import styles from '../styles/styles'; +import Text from './Text'; + +type InlineErrorTextProps = { + children: React.ReactNode; + styles: TextStyle[]; +}; +function InlineErrorText(props: InlineErrorTextProps) { + if (!props.children) { + return null; + } + + return {props.children}; +} + +InlineErrorText.displayName = 'InlineErrorText'; +export default InlineErrorText;