img-mapper/react-img-mapper

UseEffect Depth Exceeded causing unintended consequences

Closed this issue · 3 comments

Describe the bug
There is a Maximum Depth exceeded Error that is popping up once ImageMapper is used. This seems to related to useEffects. This is affecting my GET requests that are inside of my program causing them to infinite loop call. This error seems to pop up on a basic import of the react-img-mapper.

The error creates no visual bugs. The img mapper displays accurately but if i do any asyc function it causes unintended consequences.

To Reproduce
Steps to reproduce the behavior:

  1. Add the react-img-mapper to any project
  2. When the page is inspected the error "Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."
    Error on chrome

Examples
Here is a codesandbox of the error in its simplest form I could reproduce showing the error in the console.

I am unable to show the get request loop without repercussions if that is something that is needed to demonstrate.

https://codesandbox.io/p/github/rebelmaniac/basicimagempapper/master?file=%2FREADME.md&workspace=%257B%2522activeFileId%2522%253A%2522clfn2wrsw000lg1h880t7hv1x%2522%252C%2522openFiles%2522%253A%255B%2522%252FREADME.md%2522%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522spaces%2522%253A%257B%2522clfn2wt8b00153i6kgkwyryif%2522%253A%257B%2522key%2522%253A%2522clfn2wt8b00153i6kgkwyryif%2522%252C%2522name%2522%253A%2522Default%2522%252C%2522devtools%2522%253A%255B%257B%2522type%2522%253A%2522PREVIEW%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522port%2522%253A3000%252C%2522key%2522%253A%2522clfn2xibd00a03i6kbq606qdj%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522key%2522%253A%2522clfn2xg2z00653i6k2wgztsbi%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D%257D%252C%2522currentSpace%2522%253A%2522clfn2wt8b00153i6kgkwyryif%2522%252C%2522spacesOrder%2522%253A%255B%2522clfn2wt8b00153i6kgkwyryif%2522%255D%252C%2522hideCodeEditor%2522%253Afalse%257D

Expected behavior
The Img mapper will not setState infinitely affect other parts of program when implemented

Desktop (please complete the following information):

  • Browser: [Chrome]
  • Version: [1.5]

Additional notes
-Let me know if the codesandbox works
-It might be based on the latest release but I havent tested the 1.4.3 version if it has this issue so I will be testing this next

any updates on this one?

It is resolved, I will release the update ASAP.

Resolved in V1.5.1