ealush / emoji-picker-react

The most popular React Emoji Picker
https://ealush.com/emoji-picker-react/
MIT License
991 stars 166 forks source link

Emoji Picker is downloading a ton of png emojis every render #382

Closed EsotericCoder closed 7 months ago

EsotericCoder commented 7 months ago

Using emoji picker in react and it is causing my app to render slower as it waits for all the emojis to download. I noticed your demo app does not download these same emojis. How should I configure to get the same results?

` const renderEmojiPicker = () => { if (isMuted || isFrozen || isMobile) return null

const pickerClassName = `emoji-picker position-absolute z-index-top-nav ${
  showEmojiPicker ? "" : "d-none"
} ${
  emojiPickerPosition === "top" ? "emoji-picker-top" : "emoji-picker-bottom"
}`

return (
  <div className="message-input-buttons me-2">
    <button className="btn unstyled-btn" onClick={onShowEmojiPicker}>
      <Emoji />
    </button>
    <div ref={emojiPickerRef} className={pickerClassName}>
      <EmojiPicker
        onEmojiClick={onEmojiClick}
        searchDisabled={true}
        emojiStyle={"apple"}
        skinTonesDisabled={true}
        native={true}
        height={240}
        previewConfig={{
          showPreview: false,
        }}
      />
    </div>
  </div>
)

}`

ealush commented 7 months ago

Use emojiStyle "native", instead of "apple". Won't download any images.