The problem of react trigger component method

import React, { Component } from "react";
import propTypes from "prop-types"

class Record extends Component {
    constructor(props) {
        super(props);
        this.state = {
            edit: false
        }

        this.handleEdit = this.handleEdit.bind(this);
        this.handleUpdate = this.handleUpdate.bind(this);
    }
    render() {
        return this.state.edit
            ?
            <tr>
                <td><input type="text" defaultValue={this.props.record.date} className="form-control" /></td>
                <td><input type="text" defaultValue={this.props.record.title} className="form-control" /></td>
                <td><input type="text" defaultValue={this.props.record.amount} className="form-control" /></td>
                <td>
                    <button className="btn btn-primary mr-1" onClick={this.handleUpdate(this.props.record.id)}>update</button>
                    <button className="btn btn-outline-secondary" onClick={this.handleEdit}>cancel</button>
                </td>
            </tr>
            :
            <tr>
                <td>{this.props.record.date}</td>
                <td>{this.props.record.title}</td>
                <td> {this.props.record.amount}</td>
                <td>
                    <button className="btn btn-primary mr-1" onClick={this.handleEdit}>edit</button>
                    <button className="btn btn-danger">delete</button>
                </td>
            </tr>
    }
    // method
    handleEdit() {
        console.log(22222)
        this.setState({
            edit: !this.state.edit
        })
    }
    handleUpdate(id) {
        console.log(id, "handleUpdate");
    }
}

export default Record;

Record.propTypes = {
    id: propTypes.number,
    date: propTypes.string,
    title: propTypes.string,
    amount: propTypes.number
}

Why does the handleUpdate method trigger when I click on the handleEdit method?
and then click handleUpdate method will not respond

Mar.20,2021

In the

onClick event, you directly execute it. Of course, when rendering, it will trigger
and change it to this

.
<button className="btn btn-primary mr-1" onClick={e => this.handleUpdate(this.props.record.id)}>update</button>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3aac4-2c226.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3aac4-2c226.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?