...

/

Getting Rid of Extra State Variables

Getting Rid of Extra State Variables

Let's clean up the useExpanded.js file by removing extra state variables

We'll cover the following...

Using a ref Object

As discussed in the last lesson, I prefer to provide the resetDep via a ref object instead of creating a state variable. This way I’m sure to introduce only important variables as actual state variables.

The solution is similar, it’s only an internal change within our custom hook, ...