From 3a12cf87888950a88e12ce73dd7d0bc879d91c9a Mon Sep 17 00:00:00 2001 From: Denis Sikuler Date: Tue, 11 Aug 2020 18:51:28 +0300 Subject: [PATCH] Fix React warning about state update of unmounted component --- src/Truncate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Truncate.js b/src/Truncate.js index 2db1e034..ab4bd0f9 100644 --- a/src/Truncate.js +++ b/src/Truncate.js @@ -118,6 +118,7 @@ export default class Truncate extends Component { onTruncate } = this.props; + window.cancelAnimationFrame(this.timeout); if (typeof onTruncate === 'function') { this.timeout = window.requestAnimationFrame(() => { onTruncate(didTruncate);