@shapeshop/react
v0.0.4
Published
A TS hook and component to capture user mouse/stylus inputs to generate svg shapes and paths
Maintainers
Readme
ShapeShop React Hook
The hook accepts 3 arguments.
- [required] a
refto the object you wish to capture mouse events on - [required] the default
ShapeTypeyou 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.
