ignore a rule for the whole file
ignore the rule for one line
instanceoffor custom types
typeoffor the simple built-in types
Return type isn't a boolean!
Convert something to a string
- avoid enums
- use string literals instead
type Options = 'one' | 'two' | 'three'
- Inferred generic: (from the params)
React and TS¶
React.ReactElement works for an array of functions??
Type of a React "callable"¶
type that's the same name as the
When working with
progressbar.js, I was getting errors
When I tried importing the
I had to use
typeof Shape because I was importing the class
Shape rather than the type
There's a separate import for the
Example: importing from a JS library
Declare that some variable that you has this type