zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.03k stars 424 forks source link

projection="geoAlbersUsa" with ZoomableGroup center={0 ,0} return error #332

Open ezequielhernancasas opened 11 months ago

ezequielhernancasas commented 11 months ago

Hi, Its still appear the issue with zoom in projection="geoAlbersUsa". return "Cannot read properties of null (reading '0')"

Example :

<ComposableMap projection="geoAlbersUsa" projectionConfig={{ scale: scaleChart, }} data-tip=""

<ZoomableGroup center={center} zoom={5}

{({ geographies }) => geographies.map((geo) => { const centroid = geoCentroid(geo); const cur = statesText.find((s) => s.val === geo.id); return ( setCenter(centroid)} /> )} ...................
DanielGaull commented 11 months ago

Looks like it's this old bug, https://github.com/zcreativelabs/react-simple-maps/issues/275