react get data attribute from element

JavaScript
const removeId = e.target.getAttribute("data-remove");<div data-id={someId} >Test</div>

const id = e.target.getAttribute("data-id");
//alternate to getAttribute
const id = e.target.attributes.getNamedItem("data-id").value;

Source

Also in JavaScript: