Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cae410b

Browse files
committed
[Docs] Update TimerMixin docs.
Adds in install instructions for `react-timer-mixin` to the `TimerMixin` docs.
1 parent 951b5f9 commit cae410b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)