MapContainer map prop undefined
See original GitHub issueHi, I’m sorry if this question is too dumb but I’ve been struggling with the autocomplete example for days.
The autocomplete example has this function:
renderAutoComplete() {
const { google, map } = this.props;
if (!google || !map) return;
...
/*
Rest of the function here
*/
}
but in my code, this.props
is: {apiKey: “API_KEY”, loaded: true, google: Object}
Here you can see my code: https://codesandbox.io/s/vw39jx5n5
Please help me understand what is this map
prop and what is going on with the autocomplete example.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Error : Cannot read property 'map' of undefined - Stack Overflow
The error "Cannot read property 'map' of undefined" will be encountered if there is an error in the "this.props.data" or there is no...
Read more >Map creation and interactions | React Leaflet
The MapContainer component is responsible for creating the Leaflet Map instance ... When creating a MapContainer element, its props are used as options...
Read more >React Google Maps Style Guide
This documentation site is created with the awesome react-styleguidist. It comes with components documentation with props, public methods and live demo. The ...
Read more >Fix the "Cannot read property 'map' of undefined" Error in React
The variable you are trying to map over is undefined . It will probably eventually be an array, but due to the asynchronous...
Read more >React Google Maps Api Style Guide
Make sure you cache the props passed to GoogleMap to avoid re-renders that may harm ... This event is fired when the user's...
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
The component needs access to the map object. You can wrap the components in a map but only render the map in a smaller component. Would that work for you?
I’m getting the following error:
I’m using the following component Ant Design Auto-Complete
Could you help me?