Need help on updating state in pure react on Drum Machine Project

Hi All,

I am working on the Drum Machine project and I am using pure react to complete the project. I am having a problem where this.setState is not actually updating display state. I am using it to try to update the display. The link to my code is below. Any help would be appreciated.

https://codepen.io/dgebrese/pen/bGVqXZN?editors=1011

Dag

Hello there.

Just to get you going a bit more: You have not bound(binded??) any of your methods to this.

Hope this helps

Thanks very much! That solved it. I am very new to React and forgot the basics. I was stuck on this for hours. I really appreciate the help.

I understand not using JSX can help teach React fundamentals, but I would not spend too much time on it in the beginning. I’m not personally super convinced how great the benefits really are.

I actually think it might be more beneficial after having learned more about React to then go deeper and look at the fundamentals. May sound a bit backward perhaps, but I think getting dragged down into the nitty-gritty of React too early on, may not be all that beneficial.

Knowing how JSX works is definitely not a bad idea though.

Thanks for the feedback! I agree it is confusing to keep track of what is important and what is not when using different source codes at this early stage. I will stick to React with JSX and learn the transpiling process later. I really enjoy the data manipulation/algorithm side of programming but keeping track of what syntax is right in what environment can be frustrating at times.