mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 17:45:59 +00:00
68461492bc
Summary: When code blocks the UI thread for too long, it's a bad sign because this can prevent the app from remaining responsive. This change helps detect such responsiveness issues by warning when a React method executes on the UI thread longer than some threshold. **Test Plan** Changed AppState's getCurrentAppState method to sleep for 500 ms and verified that a warning was emitted: ``` 2017-08-17 19:45:29.479 [warn][tid:main][RCTModuleMethod.mm:527] mainThreadWatchdog: invocation of [RCTAppState getCurrentAppState:error:] took 501ms ``` Adam Comella Microsoft Corp. Closes https://github.com/facebook/react-native/pull/15542 Differential Revision: D5724764 Pulled By: shergin fbshipit-source-id: f1dc4bf17d3657c397720a47fabc7f32bf81b7ac