Bolt ui

Event Handlers Not Firing - onClick, onChange Not Working

You add onClick, onChange, or other event handlers to elements but they never fire. The function is defined but not being called when the event occurs.

Sometimes works in one component but not another. No console errors.

Error Messages You Might See

onClick fires immediately on render Event handler undefined Clickable element not responding to clicks handleClick is not a function

Common Causes

  1. Calling function instead of passing reference: onClick={handleClick()} instead of onClick={handleClick}
  2. Event handler called with wrong context (this binding issue)
  3. Event delegation not working - handler on parent not capturing child events
  4. Element disabled or has pointer-events: none
  5. Event handler overridden or removed after mount

How to Fix It

Pass function reference, not invocation: onClick={handleClick} not onClick={handleClick()}

To pass arguments: onClick={() => handleClick(id)} or onClick={e => handleClick(e, id)}

For disabled state: use disabled prop, not conditional rendering

Check element in DevTools - is it actually in the DOM and visible?

Use React DevTools Profiler to see if component is re-rendering on click

Real developers can help you.

Victor Denisov Victor Denisov Developer Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: 🚀 Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. 🏗️ Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ☁️ Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. 📈 Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.**

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What's the difference between onClick={fn} and onClick={fn()}?

fn is a reference, fires when clicked. fn() calls immediately on render. Use fn() => fn(args) to pass arguments

Why does my event fire immediately?

You're calling the function onClick={fn()} instead of passing reference onClick={fn}

How do I pass arguments to event handlers?

Use arrow function: onClick={() => handleClick(id, name)}

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help