react-simple-maps icon indicating copy to clipboard operation
react-simple-maps copied to clipboard

(bug) ZoomableGroup does not allow for components to remount on some projections

Open thebenjhoward opened this issue 3 years ago • 1 comments

For a code sample, Just take the second example from this page from the documentation and change the projection to "geoAlbersUsa". The error occurs as soon as you click one of the zoom buttons. However, anything that causes the map to remount results in the same error. The specific error that it gives is:

Cannot read properties of null (reading '0')

General repro steps are just:

  1. Have an albers projection map within a ZoomableGroup (other projections which only include part of the world likely do this as well)
  2. Change the zoom in any way
  3. Trigger a component remount.

This is the same error as in #70. According to the comments on that issue, it is essentially trying to do something with coordinates outside of the range of a given projection, causing the error. This makes sense since world map projections seem to not cause this error. The traceback for the error tells us that it happens during the render process. I can confirm that it occurs in both server-side rendering and client side rendering.

Issue #70 did include some workarounds, but it just seems like some values are being set in a wacky way and that it could be fixed.

thebenjhoward avatar Feb 22 '22 01:02 thebenjhoward

It has almost been a year now and this still is not resolved? Seems like the last update was 6 months ago, is this package still being maintained?

KyleWiteck avatar Jan 18 '23 23:01 KyleWiteck