From c06c23fabf7c0f8b570695d78c21437d49ea20ee Mon Sep 17 00:00:00 2001 From: Jack Ricci Date: Tue, 22 Sep 2020 11:47:38 -0400 Subject: [PATCH 1/2] Use deep equality comparison --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9ea123e..f6f84e0 100644 --- a/src/index.js +++ b/src/index.js @@ -50,7 +50,7 @@ class LinesEllipsis extends React.Component { if (prevProps.winWidth !== this.props.winWidth) { this.copyStyleToCanvas() } - if (this.props !== prevProps) { + if (!_.isEqual(this.props, prevProps)) { this.reflow(this.props) } } From f418802dd23e6cb5d87b0f0dda6bd3a2f6dfb897 Mon Sep 17 00:00:00 2001 From: Jack Ricci Date: Tue, 22 Sep 2020 12:40:56 -0400 Subject: [PATCH 2/2] Fix in correct places --- lib/html.js | 2 +- lib/index.js | 2 +- src/html.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/html.js b/lib/html.js index 7a02365..8e25d8b 100644 --- a/lib/html.js +++ b/lib/html.js @@ -162,7 +162,7 @@ function (_React$Component) { this.copyStyleToCanvas(); } - if (this.props !== prevProps) { + if (!_.isEqual(this.props, prevProps)) { this.reflow(this.props); } } diff --git a/lib/index.js b/lib/index.js index 0a29df0..6ba44f6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -102,7 +102,7 @@ function (_React$Component) { this.copyStyleToCanvas(); } - if (this.props !== prevProps) { + if (!_.isEqual(this.props, prevProps)) { this.reflow(this.props); } } diff --git a/src/html.js b/src/html.js index 0850bc9..7d49f66 100644 --- a/src/html.js +++ b/src/html.js @@ -107,7 +107,7 @@ class HTMLEllipsis extends React.Component { if (prevProps.winWidth !== this.props.winWidth) { this.copyStyleToCanvas() } - if (this.props !== prevProps) { + if (!_.isEqual(this.props, prevProps)) { this.reflow(this.props) } }