Closed begonia666 closed 6 months ago
Hi,
I resolved both of the problems you mentioned. Please upgrade to the latest version (0.2.3) as soon as possible.
In the new version, primary shapes can be changed without any issues when changing imageUrl
. Additionally, you can access annotator
in onAdded
or onContextMenu
.
If you want to set a default category in onAdded
, please use:
onAdded={shape => {annotator.updateCategories(shape.id, ["default category"])}}
Thank you so much, it works perfectly
You're welcome. Thanks for creating this issue, I really appreciate it. The two bugs were critical.
Hi
I am passing shapes from a redux state, the "imageUrl" can be changed dynamically without any problems but shapes cannot init after the ImageAnnotator receives shapes changes, seems like the component doesn't refresh itself
and for "onAdded" props, I tried to set a default category after shape drawn but the "annotator" is always undefined, I solved it by store it in a ref when "onReady" called
thank you for your time