Skip to content

Commit 67e873d

Browse files
mpeypermarkerikson
andauthored
Remove onStateChange from subscription when unsubscribing
Co-Authored-By: Mark Erikson <[email protected]>
1 parent 4734a71 commit 67e873d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/Provider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function Provider({ store, context, children }) {
2424
}
2525
return () => {
2626
subscription.tryUnsubscribe()
27+
subscription.onStateChange = null
2728
}
2829
}, [contextValue, previousState])
2930

0 commit comments

Comments
 (0)