React Hooks are a new addition in React 16.8. They let you use state and other React features without writing a React class component. React Hooks are also backward-compatible, which means it does not contain any breaking change and it does not replace your knowledge of React concepts. Over the course of this chapter, we will see an overview of Hooks for experienced React users, and we are also going to learn some of the most common React Hooks such as useState, useEffect, useMemo, useCallback and memo.
No breaking changes
Many people think that with the new React Hooks, class components are now obsolete in React, but this statement is incorrect. There are no plans to remove classes from React. The Hooks don't replace your knowledge of React concepts. Instead, Hooks provide a more direct API to the React concepts, such as props, state, context, refs, and life cycle, which you already know.
Using the State Hook
You probably know how to use the component state...