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
The issue seems to be <React.Strict>.
I think this sets debugRenderPhaseSideEffectsForStrictMode to true and calls instance.render() twice on purpose to test for issues.
So this double-registers a component starting to render, but only unqueues once when it's finished rendering.
But it also sometimes happens with Next.js running locally (when hot-reloading?). Maybe Next.js uses strict mode too, internally.
Pick one or more:
a) Make it stop. Add an instance._isRendering flag or something like that in collect.tsx
b) Link to the readme and add some workarounds for the error.
c) Log the component that's supposedly re-rendering.
d) Use <React.StrictMode> in tests.
Don't be clever and add a rule that says don't add a new currentComponent if it's the same name as the previous one. This would fail if the user had nested <Folder>s, for example.
The text was updated successfully, but these errors were encountered:
davidgilbertson
changed the title
"You are attempting to modify the store during a render cycle" fires erroneously
<React.Strict> causes "You are attempting to modify the store during a render cycle"
Mar 19, 2020
The issue seems to be
<React.Strict>
.I think this sets
debugRenderPhaseSideEffectsForStrictMode
to true and callsinstance.render()
twice on purpose to test for issues.https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js#L14.
So this double-registers a component starting to render, but only unqueues once when it's finished rendering.
But it also sometimes happens with Next.js running locally (when hot-reloading?). Maybe Next.js uses strict mode too, internally.
Pick one or more:
a) Make it stop. Add an
instance._isRendering
flag or something like that incollect.tsx
b) Link to the readme and add some workarounds for the error.
c) Log the component that's supposedly re-rendering.
d) Use
<React.StrictMode>
in tests.Don't be clever and add a rule that says don't add a new
currentComponent
if it's the same name as the previous one. This would fail if the user had nested<Folder>
s, for example.The text was updated successfully, but these errors were encountered: