react get data attribute from element
snippet in javascript

react data attributes event

user9929

const removeId = e.target.getAttribute("data-remove");

react get data attribute from element

user9177

<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;