drawShape
- Signature :
(stage: Stage, shapeId: string | number, config: Config) => void
Update shape config and redraw the shapes layer (the canvas on which we draw shapes)
How to get stage object ?
You can get the stage object using the getStage available on AnnotationViewer and AnnotationLens
#
Exampleconst stageObject = useRef<Stage | null>(null)
const onMouseClick = (shape: AnnotationShape) => { drawShape(stageObject.current, shape.id, { fill: 'red' })}
return ( <AnnotationViewer getStage={getStage} onMouseClick={onMouseClick} // other props />)