Skip to content

Commit 0087def

Browse files
committed
fix(shouldComponentUpdate): fix shouldComponentUpdate not prioritizing user defined version
1 parent b040a52 commit 0087def

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

dist/easyState.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ function easyStateHOC (WrappedComp) {
285285
}
286286

287287
shouldComponentUpdate (nextProps) {
288+
if (super.shouldComponentUpdate) {
289+
return super.shouldComponentUpdate()
290+
}
291+
288292
const { props } = this
289293
const keys = Object.keys(props)
290294
const nextKeys = Object.keys(nextProps)

dist/helloWorld.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,6 +4835,10 @@ function easyStateHOC (WrappedComp) {
48354835
}
48364836

48374837
shouldComponentUpdate (nextProps) {
4838+
if (super.shouldComponentUpdate) {
4839+
return super.shouldComponentUpdate()
4840+
}
4841+
48384842
const { props } = this
48394843
const keys = Object.keys(props)
48404844
const nextKeys = Object.keys(nextProps)

dist/simpleTodos.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,6 +4835,10 @@ function easyStateHOC (WrappedComp) {
48354835
}
48364836

48374837
shouldComponentUpdate (nextProps) {
4838+
if (super.shouldComponentUpdate) {
4839+
return super.shouldComponentUpdate()
4840+
}
4841+
48384842
const { props } = this
48394843
const keys = Object.keys(props)
48404844
const nextKeys = Object.keys(nextProps)

dist/todoMVC.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,6 +4835,10 @@ function easyStateHOC (WrappedComp) {
48354835
}
48364836

48374837
shouldComponentUpdate (nextProps) {
4838+
if (super.shouldComponentUpdate) {
4839+
return super.shouldComponentUpdate()
4840+
}
4841+
48384842
const { props } = this
48394843
const keys = Object.keys(props)
48404844
const nextKeys = Object.keys(nextProps)

src/easyState.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export default function easyStateHOC (WrappedComp) {
3232
}
3333

3434
shouldComponentUpdate (nextProps) {
35+
if (super.shouldComponentUpdate) {
36+
return super.shouldComponentUpdate()
37+
}
38+
3539
const { props } = this
3640
const keys = Object.keys(props)
3741
const nextKeys = Object.keys(nextProps)

0 commit comments

Comments
 (0)