Skip to content

Commit 7c96141

Browse files
authored
docs(events): remove event handlers on unmount in example
1 parent 04660e8 commit 7c96141

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ class HomeScreen {
200200
// Copilot tutorial finished!
201201
});
202202
}
203+
204+
componentWillUnmount() {
205+
// Don't forget to disable event handlers to prevent errors
206+
this.props.copilotEvents.off('stop');
207+
}
203208

204209
render() {
205210
// ...

0 commit comments

Comments
 (0)