Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 0.76 Regression - RCTWindowFrameDidChangeNotification is not called when dark mode is toggled #47234

Closed
jpudysz opened this issue Oct 28, 2024 · 2 comments
Labels
Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@jpudysz
Copy link

jpudysz commented Oct 28, 2024

Description

I’ve noticed another discrepancy between RN 0.75.x and RN 0.76. With the new bare starter, my iOS native notification listener is no longer called when the user changes the color scheme. Previously, I was using the RCTWindowFrameDidChangeNotification notification to receive information about screen and native color scheme changes.

RN 0.75 repo - https://github.com/jpudysz/rn-0.75-jsi-reproducer/tree/feature/repro2

Steps to reproduce

  1. Open both the 0.75 and 0.76 repos
  2. Navigate to Pods/Development Pods/Unistyles/ios/NativePlatformListener+ios.swift
  3. Add a breakpoint at line 29

For RN 0.75 - the event is reported
For RN 0.76 - the breakpoint is not hit

React Native Version

0.76.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 15.0
  CPU: (12) arm64 Apple M3 Pro
  Memory: 728.19 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.06.24.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "23"
      - "28"
      - "29"
      - "30"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 34.0.0
      - 35.0.0
    System Images:
      - android-23 | ARM 64 v8a
      - android-28 | ARM 64 v8a
      - android-29 | ARM 64 v8a
      - android-30 | ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-34 | Android TV ARM 64 v8a
      - android-34 | ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0
    wanted: 0.76.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No crash

Reproducer

https://github.com/jpudysz/rn-0.76-jsi-reproducer/tree/feature/repro2

Screenshots and Videos

RN 0.75:

Unistyles theme event was applied.

Screen.Recording.2024-10-28.at.06.52.01.mov

RN 0.76:

Unistyles theme is not applied as event was not called.

Screen.Recording.2024-10-28.at.06.55.55.mov
@react-native-bot react-native-bot added the Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. label Oct 28, 2024
@jpudysz
Copy link
Author

jpudysz commented Oct 28, 2024

One more note: both repros are running New Arch, so it's not about it

@zhongwuzw
Copy link
Contributor

Issue Fixed in #47236.

@migueldaipre migueldaipre added Resolution: PR Submitted A pull request with a fix has been provided. and removed Needs: Triage 🔍 labels Oct 28, 2024
blakef pushed a commit that referenced this issue Oct 28, 2024
…7236)

Summary:
Fixes #47234. regression from 391680f#diff-b7fda5d350ac535115fa683faa7317b43aa11f3448f95266ef9ff051c3753a6fL63

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixes regression of RCTWindowFrameDidChangeNotification not fired

Pull Request resolved: #47236

Test Plan: Demo in #47234.

Reviewed By: blakef

Differential Revision: D65058105

Pulled By: cipolleschi

fbshipit-source-id: 0e286182ed93f289cb853710e2e00801ef2d4f73
@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Resolution: PR Submitted A pull request with a fix has been provided. labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants