react-image-annotate icon indicating copy to clipboard operation
react-image-annotate copied to clipboard

next,prev & onExit not working (not even in your demo case)

Open Fischbrot opened this issue 4 years ago • 8 comments

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 avatar Jan 24 '21 16:01 Fischbrot

@Fischbrot You need to pass onExit props to ReactImageAnnotate component. e.g. <ReactImageAnnotate labelImages regionClsList={[myClassList]} images={[myImgSrcList]} onExit={handleSave} />

NikunjPansuriya avatar Feb 04 '21 10:02 NikunjPansuriya

@NikunjPansuriya i did.

https://universaldatatool.github.io/react-image-annotate/demo/

Try out the official demo. Doesn't work...

Fischbrot avatar Feb 12 '21 14:02 Fischbrot

plz help

seveibar avatar Feb 13 '21 04:02 seveibar

I have the same problems, when clicking next, it doesn’t work.

alyssazhan avatar Feb 16 '21 20:02 alyssazhan

@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.

NikunjPansuriya avatar Feb 17 '21 08:02 NikunjPansuriya

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",

TeamKeepers avatar Apr 16 '21 09:04 TeamKeepers

For me it's working with the following versions:

"react": "^16.11.0",
"react-dom": "^16.11.0"
"react-image-annotate": "^1.7.10"

NikunjPansuriya avatar Apr 16 '21 09:04 NikunjPansuriya

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}   
                . . . . 

vasut02 avatar Aug 08 '21 18:08 vasut02