Skip to content

Instantly share code, notes, and snippets.

@ablamunits
Created June 17, 2020 14:42
Show Gist options
  • Save ablamunits/52fe478d5bedff237b83f2359d9ceb0c to your computer and use it in GitHub Desktop.
Save ablamunits/52fe478d5bedff237b83f2359d9ceb0c to your computer and use it in GitHub Desktop.
type InputWithLabelsProps = {
value: string[];
onChange: (value: string[]) => void;
};
// Or, create a reusable generic type
type ValueComponent<T> = {
value: T;
onChange: (value: T) => void;
}
type InputWithLabelsProps = ValueComponent<string[]>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment