diff --git a/packages/emoji-mart/src/components/Picker/Picker.tsx b/packages/emoji-mart/src/components/Picker/Picker.tsx index 692b0fb9..e35717f3 100644 --- a/packages/emoji-mart/src/components/Picker/Picker.tsx +++ b/packages/emoji-mart/src/components/Picker/Picker.tsx @@ -106,7 +106,6 @@ export default class Picker extends Component { componentWillUnmount() { this.unregister() - this.darkMedia?.removeListener(this.darkMediaCallback) } async reset(nextState = {}) { @@ -128,6 +127,7 @@ export default class Picker extends Component { unregister() { document.removeEventListener('click', this.handleClickOutside) + this.darkMedia?.removeListener(this.darkMediaCallback) this.unobserve() }