Skip to content

Instantly share code, notes, and snippets.

View sh1989's full-sized avatar
🎃

Sam Hogarth sh1989

🎃
View GitHub Profile
@sh1989
sh1989 / typescript-safe-react-props.md
Last active October 20, 2019 21:33
TypeScript safe React props and default props merge

Given an interface definition for a property:

interface MyProps {
  foo: string,
  bar: string
}

And a partial declaring some default props