Skip to content

Commit 4af9f2d

Browse files
mikkovedrualexkrolick
authored andcommitted
Reduce confusion about adding additional fields to .this (#2142)
As a new React learner, this part was a bit confusing as I though that it was referencing `() => this.tick()` part of the code. My addition would help at least people like me.
1 parent e1abbde commit 4af9f2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/state-and-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ The `componentDidMount()` method runs after the component output has been render
244244
}
245245
```
246246

247-
Note how we save the timer ID right on `this`.
247+
Note how we save the timer ID right on `this` (`this.timerID`).
248248

249249
While `this.props` is set up by React itself and `this.state` has a special meaning, you are free to add additional fields to the class manually if you need to store something that doesn’t participate in the data flow (like a timer ID).
250250

0 commit comments

Comments
 (0)