Replies: 4 comments 1 reply
-
|
This should work. Can you confirm? |
Beta Was this translation helpful? Give feedback.
-
You should not set state in the return function of useEffect, since the return is fired when the component is unmounted, which leads to the error - |
Beta Was this translation helpful? Give feedback.
-
|
I am not sure what you are trying to achieve here tho... |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thank you for the answer. When I get new data from web socket, I need to update duration. I created sand box (without socket implementation, I used setInterval). https://codesandbox.io/s/amazing-oskar-cn6i0p?file=/src/index.js:644-760 See screenshot here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I can't figure out how to solve this error in console. Not sure if it's bug. I want that duration changes (and reset timer) when other state changes.
Here is the code:
Here is the error:
Beta Was this translation helpful? Give feedback.
All reactions