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
Imagine a world where there is a top level hookstate object in react that is created on component instantiation, then theres asyncs on asyncs that exist that reference that object.
When you click back and forward on the page, the async operation would be completed - but the hookstate object is no longer there, and the error is so bad try/catch doesn't always work.
Clean design assumes you are killing async operations on component unmount. Otherwise you risk leakage of objects and resources. React itself prints warnings to console for usestate if you do not do it. Hookstate raises an exception but can be converted to a warning too. I am fan of strict phylosophy but perhaps we can make this behavior globally configurable via configure function. Would you be able to create a PR for it?
Hi & thanks for the great product!
Imagine a world where there is a top level hookstate object in react that is created on component instantiation, then theres asyncs on asyncs that exist that reference that object.
When you click back and forward on the page, the async operation would be completed - but the hookstate object is no longer there, and the error is so bad try/catch doesn't always work.
Now imagine a world where get/set access was managed via events, signals and AbortControllers.
Ex. https://stackoverflow.com/questions/30233302/promise-is-it-possible-to-force-cancel-a-promise
What would it feel like if it were integrated into the hookstate object for easy access?
Would be interested in discussing...
The text was updated successfully, but these errors were encountered: