Let's say I create a data-custom attribute in JSX element to save some meta-data about that element.
Like:
return (
<button data-customData="red" onClick={(ev) => { console.log(ev.target.customData)}}>Teste</button>
)
If I try to acess the data-custom attribute like you see in the code I will get undefined
.
But If I try something like ev.target.style
or ev.target.id
I will not get undefined.
What is the difference and how can we acess this value ?