In some cases you may need to use the Konva
API directly. For example for exporting canvases or animations.
There are two ways to access Konva nodes/shapes from react-konva
.
Using the refs
API.
You can use the refs API to get access to a Konva node.
import { Circle } from 'react-konva'; |
Using an event object inside of the event callback
Another common way to access a Konva node is to just use an event object that you have as an argument in any event:
import { Circle } from 'react-konva'; |
Enjoying Konva? Please consider to
support the project.