From 515acdee3fbb197c746fc7d967d195699d04d153 Mon Sep 17 00:00:00 2001 From: Simon Auer Date: Sun, 24 Mar 2019 01:26:19 +0100 Subject: [PATCH] Fixed "setState on unmounted component" Although an unmount mechanism is implemented, we still get the "setState on unmounted component" error. We have managed to find the problem lying in a typo of the lifecycle method name. Instead of "componentWillUnMount" it should be "componentWillUnmount". With this, the error disappears. --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 98f728e..7a48e66 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -32,7 +32,7 @@ export class ProgressiveImage extends React.Component !this.unmounted && this.setState({ src: srcDataURI, blur: 0 })); } - componentWillUnMount() { + componentWillUnmount() { this.unmounted = true; }