GoogleMapReact/google-map-react ? reverse-engineered prompt

Reverse engineered prompt

Build me a React Google Maps component that lets me drop any React child onto a map just by giving it lat and lng props.

I want it to work like a normal map wrapper where I can set the center, zoom, and pass in my own custom marker components instead of the default Google pins. It should load the Google Maps script only when the map is actually used, and it should still be able to render on the server so it works nicely with server side rendering. The map container should fill whatever space I give it, and the markers should stay positioned correctly as I pan and zoom.

It would be great if markers can be hovered and clicked, and if I need deeper Google Maps access there should be a way to get the map and maps objects from the API callback. Please make it easy to use and include a simple example page that shows custom markers on the map.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab