react-native-performance-stats
react-native-performance-stats copied to clipboard
fix: iOS crash when reload
Crash scenario
In dev mode, after call start function, the updateStats will continue working. After reload the project, need to cancel pervious dispatch_delay function, or will crash
Solution
- use NSTimer replace dispatch_after, easy to start or stop
- add notification observer for
RCTBridgeWillReloadNotification, will stop NSTimer before reload
Other change
- format source code, use 4 spaces