You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two components they do dispatching the same dummy async request with Promise. "Test1" is using hydra-dispatch-react and "Test2" is using just only react-hooks.
When you push the "with hydra-dispatch" button, and then wait for seconds, you can see memory leak warning.
On the other hand, after you reload the test app(because that warning shows up only one time), and push the "with hooks" button, and then wait for seconds, nothing happens, it means memory leak doesn't happen.
especially on developing SPA(applications have some url paths), this problem could annoy developers.
I think hydra-dispatch-react should have an option to cancel updating state.
The text was updated successfully, but these errors were encountered:
Ok, I see, but the cancellation with react setState is done by checking the ref. I guess we could make aware dispatcherFromReact from the component reference and check it in the scheduler. It will do the same as Test2.tsx.
My guess is if you remove the code about checking the ref in Test2.tsx you would have the same issue.
hydra-dispatch-react has a memory leaking issue because it internally updates state and developers have no way to cancel it.
The steps to reproduce is below.
I created a test app to reproduce it.
https://codesandbox.io/s/eager-bhaskara-g6h08
There are two components they do dispatching the same dummy async request with Promise. "Test1" is using hydra-dispatch-react and "Test2" is using just only react-hooks.
When you push the "with hydra-dispatch" button, and then wait for seconds, you can see memory leak warning.
On the other hand, after you reload the test app(because that warning shows up only one time), and push the "with hooks" button, and then wait for seconds, nothing happens, it means memory leak doesn't happen.
especially on developing SPA(applications have some url paths), this problem could annoy developers.
I think hydra-dispatch-react should have an option to cancel updating state.
The text was updated successfully, but these errors were encountered: