JavaScript React Basics Understanding State Bind Event Handlers to Components

Leon Hoffmann
Leon Hoffmann
6,620 Points

Need to click twice to make function fire

I created a small app that is a multi step form using this video course. My app works pretty much the same than the project described here. My event handler gets called onClick on an image and should setState. It works as expected apart from every click gets only accounted when I clicked twice. So after clicking a second time all works as expected. Any idea what that is the case?

Can we see your code.