Skip to content

Instantly share code, notes, and snippets.

@mathias5r
Created November 4, 2021 01:06
Show Gist options
  • Select an option

  • Save mathias5r/bd14cc3269b193499d84a8d5e708d371 to your computer and use it in GitHub Desktop.

Select an option

Save mathias5r/bd14cc3269b193499d84a8d5e708d371 to your computer and use it in GitHub Desktop.
using generic
type MyListItemProps<T> = {
text: string;
data: T;
};
type MyListProps<T> = {
items: MyListItemProps<T>[];
onItemSelected: (item: MyListItemProps<T>) => void;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment