Quiz: Too Early

The button should say thank you when it's clicked. Instead, the thank-you is in the console as soon as the page shows, and clicks print nothing. Click the line with the mistake.

export default function App() {
    function handleVote() {
        console.log("Thanks for your vote!");
    }

    return (
        <main>
            <h1>Band of the Day: Owl Choir</h1>
            <button onClick={handleVote()}>Vote</button>
        </main>
    );
}

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

Back

2/7

Next