What is it good for?
Add a search input and use useEffect to implement a debounce on the pokemon list as a filter.
Add a search input and use useEffect to implement a debounce on the pokemon list as a filter.
Use setTimeout & clearTimeout to build a delay
SearchPanel.tsx
ListPage.tsx
ListPage.tsx
We can reuse a concrete Hook logic by extracting it into a custom Hook .
The logic to be extracted can use a single or multiple Hooks.
We simply move the logic into its own function.
In the component we just call this function.
Stick to the Hooks naming convention: use*
usePokemonDetails.ts
DetailPage.tsx
Stretch Goal: usePokemonDetails.ts
Stretch Goal: DetailPage.tsx
We learned…