I've tried , I'm getting coordinates on image and can add name. But how to add kinda tooltip or input onclick on a person in a photo, and add name, which after on hover shows there???
https://codesandbox.io/s/tag-person-react-iwfi6z?file=/src/App.js
Check here, the image of the handleEvent and Output im getting
const handleClick = (e) => {
setCoordinates((prev) => {
return {
...prev,
x: e.screenX,
y: e.screenY
};
});
};
const handleTag = () => {
setTag((prev) => {
return {
...prev,
name: name,
coordinates: {
...prev.coordinates,
x: coordinates.x,
y: coordinates.y
}
};
});