Skip to content

Commit 97bf9a6

Browse files
committed
Merge pull request #1811 from dhrrgn/dhrrgn-timermixin-docs
[Docs] Update TimerMixin docs.
2 parents 951b5f9 + cae410b commit 97bf9a6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/Timers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ InteractionManager.clearInteractionHandle(handle);
5757

5858
We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced `TimerMixin`. If you include `TimerMixin`, then you can replace your calls to `setTimeout(fn, 500)` with `this.setTimeout(fn, 500)` (just prepend `this.`) and everything will be properly cleaned up for you when the component unmounts.
5959

60+
This library does not ship with React Native - in order to use it on your project, you will need to install it with `npm i react-timer-mixin --save` from your project directory.
61+
6062
```javascript
6163
var TimerMixin = require('react-timer-mixin');
6264

0 commit comments

Comments
 (0)