Skip to content

Commit

Permalink
Call unregister(this) instead of unregister(admin), because it wa…
Browse files Browse the repository at this point in the history
…s registered with `this` as the token, not `admin`.
  • Loading branch information
wbercx committed Oct 19, 2023
1 parent 273e017 commit e55a28a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mobx-react/src/observerClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function makeClassComponentObserver(
admin.mounted = true

// Component instance committed, prevent reaction disposal.
observerFinalizationRegistry.unregister(admin)
observerFinalizationRegistry.unregister(this)

// We don't set forceUpdate before mount because it requires a reference to `this`,
// therefore `this` could NOT be garbage collected before mount,
Expand Down

0 comments on commit e55a28a

Please sign in to comment.