-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Description
🐛 Bug Report
When I toggle Perf Monitor
ON, it will not be visible after I reload/refresh the JS bundle (CMD+R
), but option in Dev Menu will persist the state correctly.
To Reproduce
- Open iOS Simulator
- Press
CMD+D
- Select
Show Perf Monitor
- Reload
CMD+R
Expected Behavior
Perf Monitor should be visible after reloading. The Dev Menu is correctly showing Hide Perf Monitor
.
Quick Fix
Persist the Perf Monitor:
- Open
RCTPerfMonitor.m
finddevMenuItem
and put this line
if (devSettings.isPerfMonitorShown) [weakSelf show];
after:
__weak __typeof__(self) weakSelf = self;
__weak RCTDevSettings *devSettings = self.bridge.devSettings;
// PUT NEW CODE HERE
Since I'm no expert on Objective-C, I didn't want to create PR with this. But if this approach is good, I can create one.
Environment
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 738.29 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
Yarn: 1.10.1 - ~/.yarn/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.0/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.1 => 16.6.1
react-native: 0.57.7 => 0.57.7