In my d3 map I tried to add tool tip by referring the below link, In the below Example they have provided in js but when I tried to implement in react it’s not working fine. Can you tell me how to fix it, providing my code snippet and sandbox below. I did research but still not able to find
Example: https://medium.com/@anilnairxyz/tooltips-in-d3-svgs-249d3b6650bd
https://codesandbox.io/s/friendly-germain-bpliqe?file=/src/components/Map.js
.style(
"left",
event.pageX - document.getElementById("root").offsetLeft + 20 + "px"
)
.style(
"top",
event.pageY - document.getElementById("root").offsetTop - 60 + "px"
);