Skip to content

Commit

Permalink
fix: reuse if there is already defined custom element
Browse files Browse the repository at this point in the history
  • Loading branch information
queue committed Oct 30, 2024
1 parent 16978d0 commit 7e32602
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/emoji-mart-react/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default function EmojiPicker(props) {
}

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

return () => {
Expand Down

0 comments on commit 7e32602

Please sign in to comment.