Skip to content

usePaint ​

browser
test coverage
Last changed: 24 days ago

Hook that allows you to draw in a specific area

typescript
import { usePaint } from '@siberiacancode/reactuse';

Usage ​

typescript
const drawing = usePaint(canvasRef);
// or
const { ref, drawing } = usePaint();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetHookTarget-The target element to be painted
options?UsePaintOptions-The options to be used

Parameters

NameTypeDefaultNote
options?UsePaintOptions-The options to be used

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax
AvatarVladPorvin

Released under the MIT License.