react-image-annotate
react-image-annotate copied to clipboard
next,prev & onExit not working (not even in your demo case)
My case:
Inserted regions with a few points => Polygon. Tried if the next,prev works - it doesn't. (No error, whatsoever)
Tried to see if it saves - it doesn't. Only gives out an error:
react-dom.production.min.js:52 Uncaught TypeError: Cannot delete property 'lastAction' of #<Object>
at onExit (index.js:23)
at index.js:145
at index.ts:12
at index.js:202
at index.ts:12
at onClick (index.js:29)
at Object.s (react-dom.production.min.js:14)
at f (react-dom.production.min.js:14)
at react-dom.production.min.js:14
at _ (react-dom.production.min.js:15)
@Fischbrot
You need to pass onExit props to ReactImageAnnotate component.
e.g.
<ReactImageAnnotate labelImages regionClsList={[myClassList]} images={[myImgSrcList]} onExit={handleSave} />
@NikunjPansuriya i did.
https://universaldatatool.github.io/react-image-annotate/demo/
Try out the official demo. Doesn't work...
plz help
I have the same problems, when clicking next, it doesn’t work.
@Fischbrot Please use 1.7.10 version it's working.
Also for the onExit click issue, you need to pass onExit prop to the component.
The only solution that was working for me was to play with my package.json
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-image-annotate": "1.7.1",
For me it's working with the following versions:
"react": "^16.11.0",
"react-dom": "^16.11.0"
"react-image-annotate": "^1.7.10"
you can reference this issue #163 it has solutions for the next and prev buttons.
Also for onExit, you just have to pass a function with a parameter as a data object
const [images, setImages] = useState( /** your images (array) will comes come here */ )
const handleExit= (data)=>{
// you can do anything with this data you can console.log(data) and see what it contains
// I personally use data.images to get the image array and its data like annotation points or x and y
// coordinates of points
}
. . . .
<ReactImageAnnotate
onExit={handleExit}
images={images}
. . . .