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 solutions proposed in #14369 seem to be workarounds to only avoid the warning from being logged, but pollute the code-base significantly, if there is a large project where hundreds or even thousands of similar methods are used. It would not make sense to add that much boiler-plate to just avoid an occasional warning.
The workarounds do not seem to be solutions to the actual problem where methods continue execution after their owner component has been unmounted. IMO, there isn't much of a difference between checking a boolean for deciding whether or not to call setState, and letting React detect that setState is called for an unmounted component. Other than producing the warning.
解决思路:通过修饰器Decorator一劳永逸 但对于Decorator的支持?那就改为使用一个函数来解决
值得关注点:setState hook inside useEffect can cause unavoidable warning Can't perform a React state update facebook/react#14369
The text was updated successfully, but these errors were encountered: