Skip to content

Instantly share code, notes, and snippets.

type StopItProps<T> = {
items: T[]
callback: (item: T, index: number) => JSX.Element
}
const stopIt = <T,>(items: StopItProps<T>['items']) => (
callback: StopItProps<T>['callback']
): JSX.Element[] =>
items.map((item, i) => (
<React.Fragment key={`corey-was-here-${i}-${Date.now()}`}>{callback(item, i)}</React.Fragment>