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

TabList React Warning when Unmounted Right after a componentDidUpdate #275

Closed
brahms opened this issue Nov 30, 2016 · 1 comment
Closed

Comments

@brahms
Copy link

brahms commented Nov 30, 2016

This function is causing a warning:

TabList.prototype.componentDidUpdate = function (prevProps) {
        var _this = this;
        if (prevProps.indicatorWrapperStyle == null) {
            setTimeout(function () { return _this.setState({ shouldAnimate: true }); });
        }
};

"Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the undefined component."

@giladgray
Copy link
Contributor

fix: track the returned timeoutId and clear it in componentWillUnmount

@cmslewis cmslewis changed the title Tablist React Warning when Unmounted Right after a componentDidUpdate TabList React Warning when Unmounted Right after a componentDidUpdate Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants