Random Quote Machine - Button Not Working

I’m totally lost here. I added a simple test button, which is not working (or the component isn’t rendering the state changes). Any help would be appreciated.

https://codepen.io/IkerSS/pen/bQvYde?editors=0010

I think you should move handleClick out of the constructor.

1 Like

First of all, thanks a lot for your reply!

Second, in order to move handleClick out of the constructor I’d need to change the arrow function into a regular one, then bind “this” inside the constructor. I was mostly wondering why the arrow function isn’t working, since it’s supposed to be placed inside the constructor and it doesn’t require any binding.

I think you can take the function that you used out of the constructor without changing it. I don’t think it is supposed to be placed inside the constructor.

Just fixed it… needed to add “this.” before “handleClick”. :man_facepalming: Now I feel dumb.
Thanks for your help.