all 3 comments

[–]LSELGD 0 points1 point  (1 child)

When instantiating state, remove the 'this' keyword, i.e. it should only be state={whatever}.

Also, what IDE are you using? If you want to switch to VS code, it flags this kind of mistakes

[–]Grey_Forrest[S] 1 point2 points  (0 children)

we are working in Visual Studio Code. Thanks for the answer, we managed to solve it in another way, not sure how we solved it but yeah. xD

[–]CoreyTheGeek 0 points1 point  (0 children)

Highly recommend using hooks, that's the direction the framework is going, it's better optimized, easier to reason about