diff --git a/examples/update-on-async-rendering/adding-event-listeners-after-continued.js b/examples/update-on-async-rendering/adding-event-listeners-after-continued.js index 9ba78f20..6241c021 100644 --- a/examples/update-on-async-rendering/adding-event-listeners-after-continued.js +++ b/examples/update-on-async-rendering/adding-event-listeners-after-continued.js @@ -10,12 +10,14 @@ class ExampleComponent extends React.Component { this.finalizeSubscription(); } // highlight-line - // highlight-range{1-9} + // highlight-range{1-11} componentDidUpdate(prevProps, prevState) { if (this.props.dataSource !== prevProps.dataSource) { // Similar to adding subscriptions, // It's only safe to unsubscribe during the commit phase. - prevProps.dataSource.dispose(); + prevProps.dataSource.unsubscribe( + this.handleSubscriptionChange + ); this.finalizeSubscription(); }