ReactJS Jvectormap: calling setstate on onRegionClick causes country to not be filled

23 Views Asked by At

My onregionclick function uses another function:

onRegionClick={handleClick}

In handleclick, I am calling state like so:

const handleClick = (e, countryCode) => {
  setGuesses(guesses + 1);
}

however, this causes the country to not fill, for no particular reason.

if i remove the setstate call and add anything else, the country fills normally.

0

There are 0 best solutions below