Keys warning in the console
See original GitHub issueHi Guys,
I am getting the following error in the console:
index.js:2178 Warning: Each child in an array or iterator should have a unique "key" prop.
Check the render method of `InfiniteScroll`. It was passed a child from . See https://fb.me/react-warning-keys for more information.
I have no idea why. Any ideas?
return (
//Implement pagination using infinite scroll
<div {...s('wrapper')}>
<InfiniteScroll
pageStart={0}
loadMore={this.loadMoreRestaurants}
hasMore={loadmore}
loader={<LoadingSpinner />}
>
<div {...s('restaurants')}>
{restaurantList.map(({ restaurant }) => (
<RestaurantCard key={restaurant.id} restaurant={restaurant} />
))}
</div>
</InfiniteScroll>
</div>
);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Warning console : Each child in a list should have a unique ...
I want to correct the warning "Each child in a list should have a unique" key "prop" in the console. I tried adding...
Read more >Generate Security Keys warning on Storefront management ...
This indicates that the Self-Signed certificates generated by storefront are expired and they needs to be renewed. You can see the certificates from...
Read more >Encountered Two Children with the Same Key — React Fix
Warning: Encountered two children with the same key, [object Object]. Keys should be unique so that components maintain their identity across ...
Read more >Silence noisy missing-key warning when it doesn't apply #12567
I'd like to request a feature that would enable us to silence the missing-key warning (https://fb.me/react-warning-keys) since it doesn't apply ...
Read more >How to resolve React console warnings about unique `key ...
After opening up the console in the browser dev tools while working on a Dash app, I noticed I was getting the following...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to add a unique key prop onto the loader.
@danbovey Can you say why this is needed?