From 8687ed3d7d256eead17234d75eea4e63bb5791ff Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Tue, 31 Oct 2023 16:32:06 +0100 Subject: [PATCH] migrate UnorderedList to TypeScript --- .../{UnorderedList.js => UnorderedList.tsx} | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) rename src/components/{UnorderedList.js => UnorderedList.tsx} (64%) diff --git a/src/components/UnorderedList.js b/src/components/UnorderedList.tsx similarity index 64% rename from src/components/UnorderedList.js rename to src/components/UnorderedList.tsx index de8cb4abd7f8..a16f52545c3b 100644 --- a/src/components/UnorderedList.js +++ b/src/components/UnorderedList.tsx @@ -1,22 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; -import _ from 'underscore'; import styles from '@styles/styles'; import Text from './Text'; -const propTypes = { +type UnorderedListProps = { /** An array of strings to display as an unordered list */ - items: PropTypes.arrayOf(PropTypes.string), -}; -const defaultProps = { - items: [], + items: string[]; }; -function UnorderedList(props) { +function UnorderedList({items = []}: UnorderedListProps) { return ( <> - {_.map(props.items, (itemText) => ( + {items.map((itemText) => (