Skip to main content


  • 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


const stageObject = useRef<Stage | null>(null)
const onMouseClick = (shape: AnnotationShape) => {  drawShape(stageObject.current,, { fill: 'red' })}
return (  <AnnotationViewer    getStage={getStage}    onMouseClick={onMouseClick}    // other props  />)