What is it good for?
What's going on here?
index.tsx
In development, when using Strict Mode , components are remounted: mount, unmount, mount.
Purpose: future-proofing the app.
Purpose: future-proofing the app
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 then call this function.
Stick to the Hooks naming convention: use*
useWindowPaste.ts
Profile.tsx
We learned…