The example given isn't relevant. If the id is coming from the props object, one can simply read it from through the closure in which case passing the data as an id to the html element and reading it from the event is useless.
If performance is a concern, one can also create a new component, pass the the necessary data as a prop and define the callback in the child.
I guess the described method could be useful for optimisation when dealing with third-party components though.
The example was to give an idea that values can be stored as data attributes. I'll update the example to access state values so it's obvious.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.