From ec87f4300a81a350169f019fdd56bcea211160bd Mon Sep 17 00:00:00 2001 From: Nastya Date: Mon, 22 Apr 2019 17:26:10 +0300 Subject: [PATCH] added throttle cancel method (#39) --- src/withSizes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/withSizes.js b/src/withSizes.js index c461fae..ef7fb16 100644 --- a/src/withSizes.js +++ b/src/withSizes.js @@ -69,6 +69,7 @@ const withSizes = (...mappedSizesToProps) => WrappedComponent => { } componentWillUnmount() { + this.throttledDispatchSizes.cancel() window.removeEventListener('resize', this.throttledDispatchSizes) }