react get data attribute code example
Example 1: event target data atributes
event.target.getAttribute("data-sortorder");
Example 2: react data attributes event
const removeId = e.target.getAttribute("data-remove");
Example 3: react get data attribute from element
<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;