Skip to content

Picker does not re-render when exceptEmojis or data changes (Web Component v5.6.0)Β #1002

@saraOrkide

Description

@saraOrkide

Hi team,

We are integrating emoji-mart v5 Web Component Picker into our React application with a dynamic custom search filtering logic. Our goal is to:

Dynamically filter emojis based on user input (searchValue)

Pass exceptEmojis to hide unwanted emojis from the picker dynamically

Avoid using the internal search input and instead control visible emojis ourselves

❗️ Problem
Currently:

When we update exceptEmojis the picker does not re-render.

We tried:

Destroying and recreating the picker instance

Calling init({ data }) again with modified data

Using a wrapper component with dynamic keys to force remount

However, the picker always uses the previously cached emoji data (SearchIndex global singleton). Even after:

await init({ data: newData });
The picker displays the previous data, not the updated filtered data.

reset() on SearchIndex empties the index and disables search altogether.

πŸ”¬ Expected Behavior
When passing updated data or a new exceptEmojis prop, we expect:

The picker to re-render with updated visible emojis

The SearchIndex or internal data cache to reset and rebuild based on new data

πŸ” Observed Behavior
Picker only uses the first initialized data

Changes in exceptEmojis or data do not reflect without a full page reload

⚠️ Limitation
Because of this singleton cache behavior:

We cannot implement dynamic filtering use cases

Users see stale emojis after changing filters or search input

πŸ’‘ Possible Solutions
We understand that the Web Component uses a global singleton. Potential solutions could be:

Exposing a forceReinit() method to reinitialize the SearchIndex with new data

Allowing the Picker to accept a data prop reactively

Documenting the limitation explicitly and suggesting recommended patterns for dynamic search & filtering without internal search input

βœ… Environment
emoji-mart version: v5.6.0

Framework: React (using as Web Component)

πŸ™ Request
Could you please advise:

Is there an officially supported way to dynamically update emojis shown in Picker?

Or should we fallback to building a custom emoji grid with emoji-mart data for this use case?

Thank you for the amazing library. Looking forward to your guidance to implement this feature optimally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions