Skip to content

Instantly share code, notes, and snippets.

@danieljpgo
Last active January 15, 2024 21:19
Show Gist options
  • Save danieljpgo/c9608dfc762d8620b1fb63d6d6b5fa81 to your computer and use it in GitHub Desktop.
Save danieljpgo/c9608dfc762d8620b1fb63d6d6b5fa81 to your computer and use it in GitHub Desktop.
export type ObjectValues<T> = T[keyof T];
export type LooseAutocomplete<T extends string> = T | Omit<string, T>;
export type PropsFrom<Component> = Component extends React.FunctionComponent<
infer Props
>
? Props
: never;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment