Skip to content

Perf Monitor - persist visibility over reload #24024

@usrbowe

Description

@usrbowe

🐛 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

  1. Open iOS Simulator
  2. Press CMD+D
  3. Select Show Perf Monitor
  4. 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:

  1. Open RCTPerfMonitor.m find devMenuItem 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions