From 7c0df4605abeb7a9cde992b73a8b599589d30115 Mon Sep 17 00:00:00 2001 From: Jiajie Zhu Date: Thu, 11 Jun 2015 13:21:57 -0700 Subject: [PATCH] [RN|madman] init AppStateIOS.currentState with 'active' --- Libraries/AppStateIOS/AppStateIOS.ios.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/AppStateIOS/AppStateIOS.ios.js b/Libraries/AppStateIOS/AppStateIOS.ios.js index e123d23be..f7dddcd57 100644 --- a/Libraries/AppStateIOS/AppStateIOS.ios.js +++ b/Libraries/AppStateIOS/AppStateIOS.ios.js @@ -122,7 +122,11 @@ var AppStateIOS = { _eventHandlers[type].delete(handler); }, - currentState: (null : ?String), + // TODO: getCurrentAppState callback seems to be called at a really late stage + // after app launch. Trying to get currentState when mounting App component + // will likely to have the initial value here. + // Initialize to 'active' instead of null. + currentState: ('active' : ?string), };