From db87ca6ce488c2c4d70b320310dd67706bbfc46e Mon Sep 17 00:00:00 2001 From: Alexander CherryTea Date: Fri, 23 Aug 2019 13:38:53 +0000 Subject: [PATCH 1/4] fix #171 - remove warnings about deprecated hook on react 16.9.0^ --- src/integrations/preact.js | 2 +- src/integrations/react.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integrations/preact.js b/src/integrations/preact.js index 81c09e3..dc6f6cc 100644 --- a/src/integrations/preact.js +++ b/src/integrations/preact.js @@ -35,7 +35,7 @@ export function connect(mapStateToProps, actions) { return this.setState({}); } }; - this.componentWillReceiveProps = p => { + this.UNSAFE_componentWillReceiveProps = p => { props = p; update(); }; diff --git a/src/integrations/react.js b/src/integrations/react.js index 6b1fd4c..672b3db 100644 --- a/src/integrations/react.js +++ b/src/integrations/react.js @@ -39,7 +39,7 @@ export function connect(mapStateToProps, actions) { return this.forceUpdate(); } }; - this.componentWillReceiveProps = p => { + this.UNSAFE_componentWillReceiveProps = p => { props = p; update(); }; From 06d6834c503171c4d3fc94522e9c064efcf4cb36 Mon Sep 17 00:00:00 2001 From: Alexander CherryTea Date: Fri, 23 Aug 2019 14:00:25 +0000 Subject: [PATCH 2/4] revert change in preact intecgration --- src/integrations/preact.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/preact.js b/src/integrations/preact.js index dc6f6cc..81c09e3 100644 --- a/src/integrations/preact.js +++ b/src/integrations/preact.js @@ -35,7 +35,7 @@ export function connect(mapStateToProps, actions) { return this.setState({}); } }; - this.UNSAFE_componentWillReceiveProps = p => { + this.componentWillReceiveProps = p => { props = p; update(); }; From 347533b2f10912aeda16143c08e7e0689c175b79 Mon Sep 17 00:00:00 2001 From: Alexander CherryTea Date: Thu, 14 Nov 2019 12:30:49 +0300 Subject: [PATCH 3/4] Update src/integrations/react.js Co-Authored-By: Jason Miller --- src/integrations/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/react.js b/src/integrations/react.js index 672b3db..0c9d5c1 100644 --- a/src/integrations/react.js +++ b/src/integrations/react.js @@ -39,7 +39,7 @@ export function connect(mapStateToProps, actions) { return this.forceUpdate(); } }; - this.UNSAFE_componentWillReceiveProps = p => { + this.getDerivedStateFromProps = p => { props = p; update(); }; From 82d9e5b44aa0e16bcd7b11c6cb7e1aa29ffcb2a9 Mon Sep 17 00:00:00 2001 From: Alexander CherryTea Date: Thu, 14 Nov 2019 11:33:41 +0000 Subject: [PATCH 4/4] revert: back to componentWillReceiveProps --- src/integrations/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/react.js b/src/integrations/react.js index 0c9d5c1..672b3db 100644 --- a/src/integrations/react.js +++ b/src/integrations/react.js @@ -39,7 +39,7 @@ export function connect(mapStateToProps, actions) { return this.forceUpdate(); } }; - this.getDerivedStateFromProps = p => { + this.UNSAFE_componentWillReceiveProps = p => { props = p; update(); };