Introduction

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…

Hellomuthu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store