Skip to content

Commit 8cbe737

Browse files
committed
Rebinds zoomListener on relevant prop change (#10)
1 parent f4d0df5 commit 8cbe737

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Tree/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ export default class Tree extends React.Component {
3636
data: this.assignInternalProperties(clone(nextProps.data)),
3737
});
3838
}
39+
40+
// If zoom-specific props change -> rebind listener with new values
41+
if (this.props.translate !== nextProps.translate ||
42+
this.props.scaleExtent !== nextProps.scaleExtent) {
43+
console.log(nextProps.translate, nextProps.scaleExtent);
44+
this.bindZoomListener();
45+
}
3946
}
4047

4148

0 commit comments

Comments
 (0)