📅  最后修改于: 2022-03-11 15:02:10.355000             🧑  作者: Mango
class Button extends React.Component {
handleId = (e) => {
/*Well if the elements are nested event.target won't always work
since it refers to the target that triggers the event in the first place.*/
console.log(e.target.id);
console.log(e.currentTarget.id);
}
render() {
return (
);
}
}