card background pattern
Level 2

Custom React Hooks

Unlock Full Course

$49.99 $24.99

Or

$24.99/Month

Binding Events with UseHover

Here we take a look at binding to DOM elements via hooks. We will use several existing react hooks in coordination to build a hook that determines if an element has been hovered over.

Downloads

Comments

Raul
Admin
5 days ago

@Steve Good question! So it looks like every time you hover over a new element inside the card it checks the condition again, interesting stuff.

Raul
Admin
updated 5 days ago

@Stephen You can use the Turbo Console Log extension for VSCode to do that

Troy
5 days ago

@Ardie Aww snap. Sweet!

Stephen
3 months ago

You highlighted isHovered and did something to immediately console.log() it on the next line. Was that a snippet or is there an extension for that?

Tristan
3 months ago

@Ardie I hope he reads this :D

Spencer
3 months ago

Still not 100% clear on why useMemo was used....

Steve
4 months ago

Hey Scott, Why is onMouseOver firing twice?

Ardie
4 months ago

Hey Scott, you can use the “rafce” snippet instead of “rafc” if you want to include the default export.

Something to say?

Become a Pro