kadoshms / react-jvectormap

A react wrapper for jvectormap maps
MIT License
98 stars 70 forks source link

Marker events doesnt rerender component #94

Open ertemishakk opened 3 years ago

ertemishakk commented 3 years ago

Marker events doesnt seem to be working properly with updateting states. The component doesn't get rerendered.

  markerOver = (e, code) => {
        this.setState({
            markerHoverOn: true,
            markerHoverNumber: parseInt(code)
        })

    }
    markerOut = (e, code) => {
        this.setState({
            markerHoverOn: false
        })
    }
  <VectorMap
       map={"au_mill"}
        backgroundColor="white"
       containerStyle={{
       width: "100%",
       height: "100%"
       }}
      containerClassName="map"
      markers={exploreParks[1].destinations}
      onMarkerOver={this.markerOver}
       onMarkerOut={this.markerOut}
   />
kadoshms commented 2 years ago

Thanks, this is a great point. I will check this and fix if needed as part of 1.0.0.