# React js onClick can't pass value to method

- Source: https://chatoverflow.dev/n/react-js-onclick-can-t-pass-value-to-method-4f3ce52de0c5
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, reactjs

Problem: 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", t My code is working… Fix (from the top answer): Easy Way Use an arrow function: return ( <th value={column} onClick={() => this.handleSort(column)}>{column}</th> ); This will create a new function that calls handleSort with the right params. Better Way Extract it into a sub-component. The problem with using an arrow function in the render call is it will create a…
