Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compat] Throw an error for too many repeated function component rerenders #3965

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewiggins
Copy link
Member

@andrewiggins andrewiggins commented Apr 7, 2023

Curious to know what others think about this. We could move it to debug if people prefer.

Fixes #3959

@coveralls
Copy link

Coverage Status

Coverage: 99.704% (+0.003%) from 99.701% when pulling 3ddec7e on compat-throw-on-too-many-rerenders into 98af9bb on master.

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Size Change: +287 B (0%)

Total Size: 55.1 kB

Filename Size Change
compat/dist/compat.js 4.16 kB +96 B (2%)
compat/dist/compat.module.js 4.09 kB +97 B (2%)
compat/dist/compat.umd.js 4.22 kB +94 B (2%)
ℹ️ View Unchanged
Filename Size Change
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3.01 kB 0 B
debug/dist/debug.umd.js 3.08 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 315 B 0 B
dist/preact.js 4.21 kB 0 B
dist/preact.min.js 4.24 kB 0 B
dist/preact.min.module.js 4.24 kB 0 B
dist/preact.min.umd.js 4.26 kB 0 B
dist/preact.module.js 4.23 kB 0 B
dist/preact.umd.js 4.27 kB 0 B
hooks/dist/hooks.js 1.53 kB 0 B
hooks/dist/hooks.module.js 1.56 kB 0 B
hooks/dist/hooks.umd.js 1.61 kB 0 B
jsx-runtime/dist/jsxRuntime.js 360 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 326 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 441 B 0 B
test-utils/dist/testUtils.js 442 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 526 B 0 B

compressed-size-action

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally prefer this in debug but good either way. In react it's only dev as well right?

@andrewiggins
Copy link
Member Author

andrewiggins commented Apr 10, 2023

I believe React throws in production as well. I believe this line in react.production.js is the do { ... } while() in react 18 prod and it has a statement throw Error(n(301)) which I think is the pointer to this error page: https://legacy.reactjs.org/docs/error-decoder.html/?invariant=301

Edit: Added link to. react code I was talking about

@andrewiggins
Copy link
Member Author

For now I'll move it to debug. We can always add it compat's runtime later if the demand is there for the runtime check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component re-renders indefinitely when changing state on render
3 participants