I am looking at this code: https://reactjs.org/docs/state-and-lifecycle.html
I do not understand why I need to use () => this.tick()
instead of just this.tick()
. The prior calls a function that uses this.tick()
, yet when I change () => this.tick()
to this.tick()
, the code stops working. this.tick()
is no longer being called even though it itself is a function. () => this.tick()
seems to be just an unnecessary step and yet it is necessary.
I think I am misunderstanding functions as objects.
Thank you