MCPcopy
hub / github.com/joshwcomeau/use-sound / Hover

Function Hover

stories/demos/Hover.js:13–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11const ARROW_DELAY = 125;
12
13function Hover() {
14 const [play, { stop }] = useSound(popsSfx, { volume: 0.5 });
15
16 const [isHovering, setIsHovering] = React.useState(false);
17
18 return (
19 <Button
20 onMouseEnter={() => {
21 setIsHovering(true);
22 play();
23 }}
24 onMouseLeave={() => {
25 setIsHovering(false);
26 stop();
27 }}
28 >
29 <ButtonContents isHovering={isHovering}>Hover over me!</ButtonContents>
30 </Button>
31 );
32}
33
34const ButtonContents = ({ isHovering, children }) => {
35 return (

Callers

nothing calls this directly

Calls 1

useSoundFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…