Skip to content

Commit

Permalink
In emoji-mart-react, fix TypeError: Illegal constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Mashinter committed Jan 24, 2025
1 parent 16978d0 commit 0907ec8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/emoji-mart-react/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default function EmojiPicker(props) {
}

useEffect(() => {
instance.current = new Picker({ ...props, ref })
const PickerElement = window?.customElements.get('em-emoji-picker')
instance.current = new (PickerElement || Picker)({ ...props, ref })

return () => {
instance.current = null
Expand Down

0 comments on commit 0907ec8

Please sign in to comment.