0.0.4 • Published 2 years ago
@shapeshop/react v0.0.4
ShapeShop React Hook
The hook accepts 3 arguments.
- required a
ref
to the object you wish to capture mouse events on - required the default
ShapeType
you want ShapeShop to interpret from these events - optional the memoized callback you want to execute on each mouse event, which is passed a CanvasUpdate when invoked.
Refer to the example Canvas component for an implementation.
Remember that ShapeShop works by giving you shape data back, its up to you to draw it or use it at all.
The example react-app has a thorough implementation.