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
exportdefaultfunctionComponent(){constvalue={something: "I'm new every render"};constdeferredValue=React.unstable_useDeferredValue(value,{timeoutMs: 3000});console.log("Component render");return(<div>{deferredValue}</div>);}
The above (buggy) component will peg the CPU and hang the browser. While this is understandable (there are theoretically infinite concurrent trees), it is an easy pitfall for someone to fall into.
Not sure if this could be identified by a console warning or lint rule.
The current behavior
Browser hangs.
The expected behavior
A lint rule informs me of my error or the console warns me that the deferred value changes every render.
The text was updated successfully, but these errors were encountered:
Hmmm. This is very strange but I can't reproduce this even with the original version and example that you added. And the new PR is meant to address this case further. I think we can close this, but if it's still reproducible with the @next builds, let me know.
React version: 0.0.0-experimental-94c0244ba
Steps To Reproduce
Attempt to load the following component:
The above (buggy) component will peg the CPU and hang the browser. While this is understandable (there are theoretically infinite concurrent trees), it is an easy pitfall for someone to fall into.
Not sure if this could be identified by a console warning or lint rule.
The current behavior
Browser hangs.
The expected behavior
A lint rule informs me of my error or the console warns me that the deferred value changes every render.
The text was updated successfully, but these errors were encountered: