Dealing with Strictness
Learn to handle TypeScript strictness.
We'll cover the following...
Current errors
In compiling the file (venue-display
), we receive several errors:
- The
venue-display
file that kicks off the call to React does not handle a potentially undefined value. - The
SortController
does aparseInt
with a potentiallynull
value. - The
debounce
method inSearchController
is nonfunctional and we’ll need to restructure that. - The
CalendarController
has a few cases where we use thetarget.dataset
. - The thunk dispatches in
App
are incompatible with any potentialnull
values.
Fixing the Errors
Using other strict options would give us more errors. In particular, the “no explicit any” might be a problem, but this should be enough for us to deal with to get the idea.
Our venue_display
file has essentially the same issue four times over. That is, we have code like ...