DevExpress / devextreme-reactive

Business React components for Bootstrap and Material-UI
https://devexpress.github.io/devextreme-reactive/
Other
2.07k stars 376 forks source link

Maximum update depth exceeded. React 18, Redux-Toolkit #3611

Open RiodeJaneiroo opened 1 year ago

RiodeJaneiroo commented 1 year ago

Is there an existing issue for this?

I'm using ...

React Chart

Current Behaviour

When we use React 18 and Redux-Toolkit we got a error Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite ##loops. Sandbox

Expected Behaviour

No response

Steps to Reproduce

Sandbox

Environment

Krijovnick commented 1 year ago

Hi @RiodeJaneiroo,

Thank you for interest in our product. In strict mode, React 18 hooks are run twice to identify unexpected results. And this change causes infinite data loops in our Chart component. As a workaround, you can remove StrictMode from the code. I'd like to note that you shouldn't get this error in production mode.

vladis-c commented 1 year ago

Hi @RiodeJaneiroo,

Thank you for interest in our product. In strict mode, React 18 hooks are run twice to identify unexpected results. And this change causes infinite data loops in our Chart component. As a workaround, you can remove StrictMode from the code. I'd like to note that you shouldn't get this error in production mode.

Your solution does not work. Not strict mode disabling nor it works in production. Please, fix it guys! Whereas people have to switch to other packages rather than yours

TimothyMather commented 1 year ago

Any update on this? I'm also seeing this error, removing StrictMode lets the charts render but I'd rather have the issue solved than just hide that the error is happening.

bryanjtc commented 1 year ago

Any update on this?