From f644af34efaa660888533b5c2d74153e673a99b1 Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Fri, 22 Jan 2016 14:44:17 -0800 Subject: [PATCH] Correctly bind Touchable.js setTimeout Summary: Fixes https://github.com/facebook/react-native/issues/5337 `this.setTimeout` is undefined and the scope wasn't being passed through causing a RedBox error. Closes https://github.com/facebook/react-native/pull/5376 Reviewed By: svcscm Differential Revision: D2838623 Pulled By: androidtrunkagent fb-gh-sync-id: 513210298b6c39d812047a03d8f2edd5c11e46f6 --- Libraries/Components/Touchable/Touchable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index f9d8e1e43..e0ea8850b 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -670,7 +670,7 @@ var TouchableMixin = { this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); } else if (!newIsHighlight && curIsHighlight && this.touchableHandleActivePressOut) { if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { - this.pressOutDelayTimeout = this.setTimeout(function() { + this.pressOutDelayTimeout = setTimeout(() => { this.touchableHandleActivePressOut(e); }, this.touchableGetPressOutDelayMS()); } else {