xunhuang / covid-19

MIT License
17 stars 16 forks source link

Bug with Navigating to new State w/ Search Bar #133

Closed tumbleshack closed 4 years ago

tumbleshack commented 4 years ago

Bug Report

To repro:

  1. Open new incognito window
  2. Navigate to any state or county location (not ROW)
  3. Using the search bar, search for a different State than you're currently in
  4. Click on that State in the search bar
  5. Error occurs

Suspected reason: In MapCountyGeneric.js, the Geographies component takes in config.geoUrl as the geographies prop. This prop is the correct URL for the json corresponding to the newly navigated State.

However, a console log reveals that the array passed to the geographies child of the Geographies component is the array for the old state that the user navigated from. Seems that the component is not re-rendering?

Fix Attempted by #132 (not yet working): Manually fetch the geographies array from config.geoUrl, then pass this array into the Geographies component. Console logs (checked in to this PR) reveal that this solution did indeed pass the correct array to the geographies child, but now, nothing is rendering.

Been struggling with this for a while and feel stuck. Any help would be appreciated!

xunhuang commented 4 years ago

this is indeed a bug. thanks for reporting. I will take a look at your PR after lunch.

tumbleshack commented 4 years ago

Closed by 9a132d6