Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 5885b8e

Browse files
author
Federico Zivolo
committed
fix: memory leak (thanks @piecyk)
1 parent 19566fe commit 5885b8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Reference.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class InnerReference extends React.Component<
2222
safeInvoke(this.props.setReferenceNode, node);
2323
};
2424

25+
componentWillUnmount() {
26+
safeInvoke(this.props.innerRef, null);
27+
}
28+
2529
render() {
2630
warning(
2731
Boolean(this.props.setReferenceNode),

0 commit comments

Comments
 (0)