Skip to content

Commit f2776ab

Browse files
authored
fix: ensure we always return boolean from shouldComponentUpdate
1 parent 49ad94d commit f2776ab

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Lifecycles/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export class Lifecycles extends Component<ILifecyclesProps, {}> {
2626
}
2727

2828
shouldComponentUpdate (nextProps) {
29-
const fn = this.props.shouldUpdate;
30-
return fn ? fn(nextProps, this.props) : true;
29+
return fn ? Boolean(fn(nextProps, this.props)) : true;
3130
}
3231

3332
getSnapshotBeforeUpdate(prevProps) {

0 commit comments

Comments
 (0)