Skip to content

Commit 2ded8eb

Browse files
If revision has value update only if it doesn't match previous value
1 parent 5370feb commit 2ded8eb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/factory.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ export default function plotComponentFactory(Plotly) {
6868
}
6969

7070
shouldComponentUpdate(nextProps) {
71-
if (isNumeric(nextProps.revision) && isNumeric(this.props.revision)) {
72-
// If revision is numeric, then increment only if revision has increased:
73-
return nextProps.revision > this.props.revision;
74-
} else {
75-
return true;
76-
}
71+
return (
72+
nextProps.revision === void 0 ||
73+
nextProps.revision !== this.props.revision
74+
);
7775
}
7876

7977
componentDidMount() {

0 commit comments

Comments
 (0)