Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Learning Resources

Donna Zukowski
Donna Zukowski
526 Points

<button className="counter-action increment" onClick={() => this.incrementScore}> + </button> isn't working.

The arrow function doesn't work with LiveServer in my Chrome Browser. I get no error. It just doesn't work. Any ideas?

1 Answer

Have you tried something of the form

<button class="counter-action increment" onClick="( () => incrementScore() ) ()"> + </button>

where you wrap your function in parentheses, call it by adding (), and put the code for onClick in quotes?