From e45d125ae9275e7312e40b5bcabda5a36b73d4fc Mon Sep 17 00:00:00 2001 From: phiresky Date: Sat, 25 Mar 2017 21:02:25 +0100 Subject: [PATCH] remove functiongraph on unmount --- src/JXGBoard/FunctionGraph/FunctionGraph.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/JXGBoard/FunctionGraph/FunctionGraph.js b/src/JXGBoard/FunctionGraph/FunctionGraph.js index e03b45c..611662c 100644 --- a/src/JXGBoard/FunctionGraph/FunctionGraph.js +++ b/src/JXGBoard/FunctionGraph/FunctionGraph.js @@ -21,6 +21,10 @@ export class FunctionGraph extends Component { } } + componentWillUnmount() { + this.context.board.removeObject(this.functionGraph); + } + //called only if shouldComponentUpdate returns true //use to render any child elements render() {