Dealing with Strictness
Explore how to address TypeScript strictness issues in a Rails frontend environment. Understand managing union types, resolving undefined values, adjusting configuration settings, and refining type declarations to prevent runtime errors and improve code robustness.
We'll cover the following...
We'll cover the following...
Current errors
Compiling the file, I get a few errors:
- The
venue-displayfile that is kicking off the call to React is not handling a potential undefined value. - Turbolinks can only be default-imported using the
allowSyntheticDefaultImports. - The
dispatchcall to redux-thunk includes a type error that I don’t understand yet.
This is fewer than I was expecting, honestly. You can get more errors with other strict options, but they don’t seem tremendously useful to me to talk about.
Fixes
I’m going to fix the Turbolinks issue by adding the line ...