Last active
April 18, 2021 05:57
-
-
Save davidgilbertson/5e0853d2e1d8a2148a57d5b9f542735f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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