Open SimmonsRitchie opened 5 years ago
I got it working by changing
data-tip={geography.properties.name}
to
data-tip={geography.properties.NAME}
My workaround: Render react-tooltip near your react-simple-map component.
<React.Fragment>
<ReactTooltip />
<MyMapComponent />
</React.Fragment>
And in MyMapComponent, for each Geography component inside your data loop:
<Geography
key={KEY}
data-tip={YOUR TOOLTIP TEXT FOR THIS ITEM}
onMouseEnter={() => {
ReactTooltip.rebuild(); <= rebuild tooltip
}}
/>
"react-simple-maps": "^2.0.0", "react-tooltip": "^4.2.0",
Hi there. Firstly: great package, especially for a React beginner like myself.
Unfortunately, I'm having problems with the 'with-react-tooltip' example. No tooltip is appearing as I hover over countries. I believe I've followed the example exactly:
I have been able to successfully implement wsdm-tooltip, as suggested here in #15, however I'd prefer to use react-tooltip if possible. I also thought it might be worth flagging this in case other folks have problems with this example.
I was initially using react-tooltip 3.10.0 and I downgraded to 3.3.0 (as used in the example), but that didn't make any difference. I'm using React 16.8
Any help would be much appreciated. Thanks.