-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

React Interview Guide
By :

Hooks were introduced in function components to reap the benefits of React features without writing any classes and life cycle methods. Most developers use Redux, Recoil, Mobx, and other third-party libraries to manage the global state in large-scale applications. But when you use React Hooks such as useContext
and useReducer
together, it becomes a better alternative for external state management. Hooks are much easier to use than complex external libraries that involve excessive amounts of boilerplate code, repetitive files, and folders across the application. React also provides numerous other built-in Hooks that can be useful for various use cases in React applications. If there is no specific built-in Hook available to handle your use case, you can create your own Hook to fulfill your business needs. Some common use cases (or cross-cutting concerns) for Hooks are authentication, logging, caching, data fetching, and...