Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS Migration] migrate UnorderedList.js to TypeScript #30641

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 (
JKobrynski marked this conversation as resolved.
Show resolved Hide resolved
<>
{_.map(props.items, (itemText) => (
JKobrynski marked this conversation as resolved.
Show resolved Hide resolved
{items.map((itemText) => (
<View
key={itemText}
style={[styles.flexRow, styles.alignItemsStart, styles.ml2]}
Expand All @@ -30,7 +25,4 @@ function UnorderedList(props) {
}

UnorderedList.displayName = 'UnorderedList';
UnorderedList.propTypes = propTypes;
UnorderedList.defaultProps = defaultProps;

export default UnorderedList;
Loading