sergiop / react-giphy-searchbox

Responsive and customizable search and select for Giphy's GIFs and Stickers.
https://sergiop.github.io/react-giphy-searchbox/
MIT License
48 stars 19 forks source link

Duplicate component keys #56

Open johannbuscail opened 3 years ago

johannbuscail commented 3 years ago

While scrolling in the box, I have this error of duplicate keys:

Warning: Encountered two children with the same key, `3o7aD0Xi3CU1GWNgM8`. 
Keys should be unique so that components maintain their identity across updates. 
Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.

Here is my code:

<ReactGiphySearchbox
    apiKey="_API_KEY_"
    library="gifs"
    onSelect={(item: any) => console.log(item)}
/>

It's the most basic code.

2kuniverse commented 2 years ago

I'm getting the duplicate keys issue as well - and the objects are being stored in memory as the JS GC doesn't know it needs to clean them up, so it's also causing a large memory leak.