Skip to main content

setShapeConfig

  • Type : (stage: Stage, shapeId: string | number, config: Config) => Promise

Only update shape config without redrawing shapes layer

How to get stage object ?

You can get the stage object using the getStage available on AnnotationViewer and AnnotationLens

Example#

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