Skip to content

Commit

Permalink
fix: eventlinsteners for functional component (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxlee0927 authored and dannyrb committed Nov 21, 2019
1 parent 2b6735d commit 7ee4577
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CornerstoneViewport/CornerstoneViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ class CornerstoneViewport extends Component {

if (isOverlayVisible !== prevIsOverlayVisible)
this.setState({ isOverlayVisible });

// Rebind event listeners when props change to handle functional component method
this._bindExternalEventListeners(true);
this._bindExternalEventListeners();
}

/**
Expand Down

0 comments on commit 7ee4577

Please sign in to comment.