Skip to content

Instantly share code, notes, and snippets.

@mathieu-anderson
Last active September 1, 2019 12:59
Show Gist options
  • Save mathieu-anderson/0fee28781f7c7dc6a18bacb06307faf2 to your computer and use it in GitHub Desktop.
Save mathieu-anderson/0fee28781f7c7dc6a18bacb06307faf2 to your computer and use it in GitHub Desktop.
Defining types
// Defining types
type InputValue = string | number;
type Label = string;
function TypeTsInput(props: { value: InputValue; label: Label }) {
const { value, label } = props;
return (
<div className="container">
<div className="label">{label}</div>
<div className="typeof">
Type: <b>{typeof value}</b>
</div>
<input value={value} />
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment