The scenario is simple - I have some spans that when I click on them I use the event "e" to track what element the user clicked on (I have many elements like this) so getting the "e.target" is pretty simple from onClick like this:
React.createElement('span', {
onClick: this._toggleIcons
}, span);
_toggleIcons: function(e){
$(e.target).toggleClass("show");
},
So far so good.
However now I need to pass some additional parameters to the event "e" but I don't know how to do that. I cannot see whether this is possible/impossible.
React.createElement('span', {
onClick: this._toggleRemoveOption( ?params? )
}, span2);
_toggleRemoveOption: function(e, param1, param2){
$(e.target).toggleClass("remove");
console.log(e.target);
console.log(param1);
console.log(param2);
},
So my question is this - how to white my onClick event handler parameters so that I can use them (param1, param2) and also have access to "e.target"?
Thank you