0

I want to read the onClick event value properties. But when I click on it, I see something like this on the console:
SyntheticMouseEvent {dispatchConfig: Object, dispatchMarker: “.1.1.0.2.0.0:1”, nativeEvent: MouseEvent, type: “click”, target

My code is working correctly. When I run I can see {column} but can’t get it in the onClick event.
My Code:
var HeaderRows = React.createClass({
handleSort: function(value) {
console.log(value);
},
render: function () {
var that = this;
return(

{this.props.defaultColumns.map(function (column) {
return (

{column}

);
})}
{this.props.externalColumns.map(function (column) {
// Multi dimension array – 0 is column name
var externalColumnName = column[0];
return (

{externalColumnName}

);
})}

);
}
});

How can I pass a value to the onClick event in React js?

Kuldeep Baberwal Changed status to publish February 4, 2025