()
| 11 | const ARROW_DELAY = 125; |
| 12 | |
| 13 | function 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 | |
| 34 | const ButtonContents = ({ isHovering, children }) => { |
| 35 | return ( |
nothing calls this directly
no test coverage detected
searching dependent graphs…