What is wrong with this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
16th Feb 2020, 7:11 PM
prime omondi
prime omondi - avatar
2 Answers
+ 6
Just read Caviղ's answer:) Maybe your code is supposed to look like this: <Removed after Caviղ's reply> If that's what you want then you have 2 problems in your code. -First: You forgot "this" in line 61. -Second: Line 43 in your code. That syntax is a named line of code that does nothing. "increase: " here is a label not an object property. Use state.increase to access its property. I'm a React noob. Maybe there's better way. Feel free to correct me ;-)
16th Feb 2020, 7:57 PM
Kevin ★
+ 2
this.state should be initiated in constructor() https://code.sololearn.com/WDN92VSYID2P/?ref=app
17th Feb 2020, 1:19 AM
Calviղ
Calviղ - avatar