Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active April 18, 2021 05:57
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/5e0853d2e1d8a2148a57d5b9f542735f to your computer and use it in GitHub Desktop.
Save davidgilbertson/5e0853d2e1d8a2148a57d5b9f542735f to your computer and use it in GitHub Desktop.
type BaseEntityWithFancyId<IdType> = {
id: IdType;
name: string;
};
const Select = <IdType extends string>(props: {
options: Array<BaseEntityWithFancyId<IdType>>;
selectedItemId?: IdType;
onSelect: (id: IdType) => void;
}) => (
// ...The rest of it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment