Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active April 18, 2021 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidgilbertson/cb1e027a39ac81ede1a5341ee308f7cb to your computer and use it in GitHub Desktop.
Save davidgilbertson/cb1e027a39ac81ede1a5341ee308f7cb to your computer and use it in GitHub Desktop.
const List = <ItemType extends any>(props: {
items: ItemType[];
renderItem: (item: ItemType) => React.ReactNode;
}) => (
<>{props.items.map(props.renderItem)}</>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment