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
onClick fires immediately on renderEvent handler undefinedClickable element not responding to clickshandleClick 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.

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