useSurfaceHover
Tracks what the reader points at on a surface, for a mouse by hover and for a finger by a still tap on an interactive canvas.
@internote/canvas-sdk/reactOn this page
import { useSurfaceHover } from '@internote/canvas-sdk/react';#Signature
<T>(options?: SurfaceHoverOptions<T>): SurfaceHover<T>#Parameters
optionsHow to find what is under the pointer, and whether the canvas is interactive.
#Example
const { hovered, bind } = useSurfaceHover<number>({ pick: (e) => vertexAt(pointOf(e)), interactive });
<svg {...bind}>{vertices.map((v, i) => <circle key={i} className={hovered === i ? 'on' : ''} />)}</svg>Declared in packages/canvas-sdk/src/react/use-surface-hover.ts:88.