Building a Custom Hook

In addition to render props and higher-order functions, a custom hook represents yet another way to share stateful logic. A custom hook is a JavaScript function whose name starts with “use” and that may call other Hooks.