Warning: Each child in a list should have a unique "key" prop.
See original GitHub issueGetting a Warning: Each child in a list should have a unique "key" prop.
error when using this library inside a React Typescript application.
To reproduce:
- Inside a react with typescript app, initialize GooglePlacesAutocomplete with most basic configurations
- Start typing the ABCs, around 5-10 characters, this warning floods the console.
I probably could fix it and make a PR, but I thought I should submit the issue first.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Warning: Each Child in a List Should Have a Unique 'key' Prop
When creating a list in the UI from an array with JSX, you should add a key prop to each child and to...
Read more >Understanding unique keys for array children in React.js
Each child in an array should have a unique "key" prop. However, in many cases it is not! This is anti-pattern that can...
Read more >How to Fix 'Each child should have a unique key prop' - Webtips
The "Each child in a list should have a unique "key" prop." warning happens in React when you create a list of elements...
Read more >Each child in a list should have a unique "key" prop in react js ...
How to solve Warning : Each child in a list should have a unique " key" prop in react js is shown.
Read more >[SOLVED] Each child in a list should have a unique "key" prop ...
Hello today in this video i'm going to show how to fix this warning, that may cause you some problems later when you...
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
I think the problem is on Google’s side. Sometimes their API omits the id from the returning JSON for no reason 😬
For example, I intercepted this URL in the DevConsole:
If I fetch it repeatedly, sometimes
id
is included, sometimes it’s not 😒Good response:
Bad one:
Yeah it’s weird, the error only happens once and after it happens, it doesn’t complain again. I’ll take a look sometime in the near future haha