react / react/react-native

rtl to ltr not working on latest version(0.77) until manual refresh

未关闭
#49,451 15 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs: Attention Needs: Repro Needs: Version Info Resolution: PR Submitted
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

setTimeout(() => {
I18nManager.forceRTL(true);
RNRestart.Restart();
}, 200);

the same code worked on previous versions but when I updated my latest code to latest version 0.77 not working properly

"react-native-restart": "^0.0.27",

"react-native": "0.77",
Steps to reproduce

setTimeout(() => {
I18nManager.forceRTL(true);
RNRestart.Restart();
}, 200);

the same code worked on previous versions but when I updated my latest code to latest version 0.77 not working properly

"react-native-restart": "^0.0.27",

"react-native": "0.77",
React Native Version

0.77

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx @react-native-community/cli info
warn Package react-native-sqlite-storage contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
  OS: macOS 15.2
  CPU: (10) arm64 Apple M4
  Memory: 743.67 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.6.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: ~/Desktop/tf-app/node_modules/.bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: ^18.3.1
  react-native:
    installed: 0.77.0
    wanted: ^0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.77.1 is now available (your project is running on v0.77.0).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.77.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.77.0&to=0.77.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
asifraza@Asifs-Mac-mini tf-app %
Stacktrace or Logs
-
Reproducer
Screenshots and Videos

setTimeout(() => {
I18nManager.forceRTL(true);
RNRestart.Restart();
}, 200);

the same code worked on previous versions but when I updated my latest code to latest version 0.77 not working properly

"react-native-restart": "^0.0.27",

"react-native": "0.77",

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 React Native 0.77 中的 I18nManager.forceRTL(true) 和 RNRestart.Restart() 入口开始,将它们在 Android 和 iOS 上的行为与上一版本进行比较。完整的调查应解释为什么 RTL 只有在手动刷新后才会生效,并使用可复现的示例验证该行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react-native
领域
internationalization, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。