8000 add onPurge hook · cpbotha/react-plotly.js@dd165a3 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit dd165a3

Browse files
add onPurge hook
1 parent 890d15c commit dd165a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/factory.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ export default function plotComponentFactory(Plotly) {
131131
}
132132

133133
componentWillUnmount() {
134+
if (this.props.onPurge) {
135+
this.props.onPurge(this.el);
136+
}
134137
if (this.resizeHandler && isBrowser) {
135138
window.removeEventListener('resize', this.handleResize);
136139
this.resizeHandler = null;
@@ -269,6 +272,7 @@ export default function plotComponentFactory(Plotly) {
269272
frames: PropTypes.arrayOf(PropTypes.object),
270273
revision: PropTypes.number,
271274
onInitialized: PropTypes.func,
275+
onPurge: PropTypes.func,
272276
onError: PropTypes.func,
273277
onUpdate: PropTypes.func,
274278
debug: PropTypes.bool,

0 commit comments

Comments
 (0)
0