React js onClick can't pass value to method

后端 未结 30 1701
北荒
北荒 2020-11-22 07:05

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: Ob         


        
30条回答
  •  旧巷少年郎
    2020-11-22 07:41

    This is my approach, not sure how bad it is, please comment

    In the clickable element

    return (
           {column}
    );
    

    and then

    handleSort(e){
        this.sortOn(e.currentTarget.getAttribute('data-column'));
    }
    

提交回复
热议问题