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
{{ message }}
Repository navigation
calling setState inside renderRest function throws warning #23
I'm trying to call setState inside the function that deals renderRest, in order to use those overflow elements inside a popup element.
But when calling the setState to keep those items for next render, I'm getting a warning in the console:
I click on a button which fires "onFinish" of form and I close the popover by changing its state.
And I get this warning that the state(not my popover state) was set after component unmount.
After going through my code for any useEffect or setState mistake. I can confirm that this is happening in code.
This error is not coming for single Select mode. Drilling in error log it indicates the error is coming from Overflow Component.
Attaching screenshot.
Activity
LohitakshTrehan commentedon Jun 7, 2023
I am facing same issue. I am rendering AntD Select in mode="multiple".
My JSX looks like following:
I click on a button which fires "onFinish" of form and I close the popover by changing its state.
And I get this warning that
the state(not my popover state) was set after component unmount.After going through my code for any useEffect or setState mistake. I can confirm that this is happening in code. This error is not coming for single Select mode. Drilling in error log it indicates the error is coming from Overflow Component. Attaching screenshot.
LohitakshTrehan commentedon Jun 7, 2023
LohitakshTrehan commentedon Jun 7, 2023
@afc163 @zombieJ ^
jlissner commentedon Aug 3, 2023
I am seeing this error everywhere after updating to latest version of ant design :( would love some guidance
PavelGavlik commentedon Aug 31, 2023
Any news regarding this issue? There seems to be even a fix in #37
chienweiluo commentedon Sep 14, 2023
Same here. I met this when using multiple Select in antd@5.7.3.
update:
After edit the
node_modules/rc-overflow/lib/hooks/useEffectState.jswith PR#37 as @PavelGavlik mentioned, the error disappears.the AbortController like #39 works in my scenario also(roughly), but I still have no solution without injection. Any solution for consumers so far?