Are your components complex with too many states and props?. It is time to use UseReducer and UseContext hooks now to simplify them and keep them clean.
In this article, we will see how to use useReducer and useContext hooks together with typescript in a step-by-step guide. If you are not familiar with useReducer and useContext, have read through in ReactJS site
What is useReducer?. https://reactjs.org/docs/hooks-reference.html#usereducer
What is useContext?. https://reactjs.org/docs/hooks-reference.html#usecontext
To showcase the use of useReducer and useContext hooks, we will create a simple poker game app in React and manage the game state using useReducer/useContext hooks. Let’s get started…