Using utility Hooks
We start by learning about utility Hooks. These are Hooks that allow us to model certain use cases or help us when developing our own Hooks, as in Chapter 12, Building Your Own Hooks.
We are now going to set up a demo page in our blog app to be able to test out the various utility Hooks.
Let’s get started setting up the demo page to test out these Hooks:
- Copy the
Chapter08_2
folder to a newChapter09_1
folder by executing the following command:$ cp -R Chapter08_2 Chapter09_1
- Open the new
Chapter09_1
folder in VS Code. - Create a new
src/components/demo/
folder. This is where we will put our demo components later to try out the various Hooks we will learn about. - Create a new
src/pages/Demo.jsx
file, with the following content:export function Demo() { return <h1>Demo Page</h1> }
- Edit
src/App.jsx
and import theDemo
page:import { Demo } from './pages/Demo...