- Imports between files can turn into a mess very quickly
- Communicating types over to your components can be challenging
- Type def files for Redux, React-Redux, and others are possibly over-engineered
In the upcoming lecture, we will be adding our searchRepositories action. You will likely see a TS error in the catch block that says Object is of type 'unknown'
There are two ways that you can resolve this for now:
Option #1
} catch (err: any) { Option #2
...
} catch (err) { if (err instanceof Error) { dispatch({ type: ActionType.SEARCH_REPOSITORIES_ERROR, payload: err.message, }); } }