Skip to content

Commit c0e8b7b

Browse files
authored
Adds component will unmount - closes #248
1 parent c70a04f commit c0e8b7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/GoogleApiComponent.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ export const wrapper = input => WrappedComponent => {
7979
google: null
8080
});
8181
}
82+
83+
componentWillUnmount() {
84+
if (this.unregisterLoadHandler) {
85+
this.unregisterLoadHandler();
86+
}
87+
}
8288

8389
initialize(options) {
8490
// Avoid race condition: remove previous 'load' listener

0 commit comments

Comments
 (0)