Dealing with Strictness
Learn to handle TypeScript strictness.
We'll cover the following...
We'll cover the following...
Current errors
In compiling the file (venue-display), we receive several errors:
- The
venue-displayfile that kicks off the call to React does not handle a potentially undefined value. - The
SortControllerdoes aparseIntwith a potentiallynullvalue. - The
debouncemethod inSearchControlleris nonfunctional and we’ll need to restructure that. - The
CalendarControllerhas a few cases where we use thetarget.dataset. - The thunk dispatches in
Appare incompatible with any potentialnullvalues.
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 element.dataset["rows"], which is now technically of type ...