TypeScript
Practice repo
{}
which, in TypeScript, means “any non-null value”
Types vs interfaces
type aliases can act sort of like interfaces, however, there are 3 important differences ( union types, declaration merging)
use whatever suites you and your team, just be consistent
always use
interface
for public API's definition when authoring a library or 3rd party ambient type definitionsconsider using
type
for your React Component Props and State
Links
Last updated
Was this helpful?