From b5904b0fb28fbae299388af779acda0115f22131 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 30 Jun 2015 18:00:33 +0000 Subject: [PATCH] update website --- docs/timers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/timers.html b/docs/timers.html index e37debbc316..dccd30689fd 100644 --- a/docs/timers.html +++ b/docs/timers.html @@ -4,7 +4,7 @@ // run animation... (`runAfterInteractions` tasks are queued) // later, on animation completion: InteractionManager.clearInteractionHandle(handle); -// queued tasks run if all handles were cleared

TimerMixin #

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.

var TimerMixin = require('react-timer-mixin'); +// queued tasks run if all handles were cleared

TimerMixin #

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.

var TimerMixin = require('react-timer-mixin'); var Component = React.createClass({ mixins: [TimerMixin],