mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 03:26:07 +00:00
[Docs] Update TimerMixin docs.
Adds in install instructions for `react-timer-mixin` to the `TimerMixin` docs.
This commit is contained in:
parent
951b5f9517
commit
cae410bda0
@ -57,6 +57,8 @@ InteractionManager.clearInteractionHandle(handle);
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var TimerMixin = require('react-timer-mixin');
|
var TimerMixin = require('react-timer-mixin');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user