Skip to content

Instantly share code, notes, and snippets.

@janjakubnanista
Last active June 6, 2020 12:57
Show Gist options
  • Save janjakubnanista/bc616bbc7fc722377ada0418e4b46644 to your computer and use it in GitHub Desktop.
Save janjakubnanista/bc616bbc7fc722377ada0418e4b46644 to your computer and use it in GitHub Desktop.
Generic function component 1: props
export interface SelectProps<T> {
// The list of items
items: T[];
// The selected item
value?: T;
// And our change handler
onChange: (value: T) => void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment