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

RTL Layout Direction does not Work after the application is reloaded/Restarted in IOS updated React Native architecture #47583

Closed
bhojaniasgar opened this issue Nov 13, 2024 · 3 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Resolution: Duplicate Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@bhojaniasgar
Copy link

Description

Issue Description:
When leveraging the I18nManager module to switch between Right-to-Left (RTL) and Left-to-Right (LTR) layout directions, the UI does not immediately reflect these changes upon app reload, though animations are correctly updated. This behavior is specific to the new React Native architecture, where the layout direction and related styles (e.g., text-align: right) are only properly applied after a full restart of the application, rather than on reload or with the react-native-restart method.

Steps to reproduce

  • Initialize a React Native project with the new architecture enabled.
  • Use I18nManager.forceRTL(true/false) to change the layout direction.
  • Trigger a restart using the react-native-restart command.
  • Observe that the UI does not immediately update (styles like text-align: right are not enforced until the app is fully restarted).

React Native Version

0.76.1

Affected Platforms

Runtime - iOS

Areas

Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.1
  CPU: (8) arm64 Apple M2
  Memory: 228.64 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.13.0
    path: ~/.nvm/versions/node/v20.13.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v20.13.0/bin/yarn
  npm:
    version: 10.8.3
    path: ~/.nvm/versions/node/v20.13.0/bin/npm
  Watchman:
    version: 2024.09.23.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/asgarbhojani/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12550806
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/asgarbhojani/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0
    wanted: 15.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

There is no crash

Reproducer

https://github.com/bhojaniasgar/RTLIssue

Screenshots and Videos

Simulator.Screen.Recording.-.iPhone.16.-.2024-11-11.at.12.13.21.mp4
@bhojaniasgar bhojaniasgar added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Nov 13, 2024
@bhojaniasgar bhojaniasgar changed the title The Right-to-Left (RTL) layout direction does not refresh after the application is reloaded with the updated React Native architecture RTL Layout Direction does not Work after the application is reloaded/Restarted in IOS updated React Native architecture Nov 13, 2024
@shubhamguptadream11
Copy link
Collaborator

Duplicate of this issue: #45661

@shubhamguptadream11 shubhamguptadream11 added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Nov 13, 2024
@AsherSheikh
Copy link

any success ??

@cortinico
Copy link
Contributor

Closing as duplicate of this issue: #45661
as @shubhamguptadream11 pointed out 👍

@cortinico cortinico closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Resolution: Duplicate Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants