Dilemmas with React Hooks – Part 1: States and Reducers
yearn2learn.netlify.com
yearn2learn.netlify.com
It's worth mentioning that if you use TypeScript, it is possible to strongly type your dispatch function to only accept valid actions. In fact TS is smart enough to type check the individual properties of different actions based on the string value of the `type` property.
You can use that with the new React Context API mentioned at the end of the article to build yourself a strongly-typed, self-contained mini redux and react-redux alternative.
Although this article shows that hooks have greater implications than that. Also while maybe less verbose than classes, the code seems much more difficult to follow.