React | Event Handling | Question 6

Last Updated :
Discuss
Comments

What will be the output of the following code?

JavaScript
class App extends React.Component {
    handleClick = (event, message) => {
        console.log(message);
    };

    render() {
        return (
            <button onClick={(e) => this.handleClick(e, "Hello World")}>
                Click Me
            </button>
        );
    }
}


undefined

Hello World

e

null

Share your thoughts in the comments