How to use useReducer and useContext hooks together with Typescript in React

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.