From da09543a99e88291190756b28cd617eddc8d3d27 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Dec 2019 16:46:27 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20use=20constructor()=20ins?= =?UTF-8?q?tead=20of=20UNSAFE=5FcomponentWillMount()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/gaearon/react-side-effect/issues/62 --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 71108e9..9872b39 100644 --- a/src/index.js +++ b/src/index.js @@ -67,7 +67,8 @@ export default function withSideEffect( return recordedState; } - UNSAFE_componentWillMount() { + constructor(props, context) { + super(props, context); mountedInstances.push(this); emitChange(); }