Skip to content

Remove left / right swap in RTL - #60459

Open
zoontek wants to merge 2 commits into
react:mainfrom
zoontek:rtl-rework-2
Open

zoontek wants to merge 2 commits into
react:mainfrom
zoontek:rtl-rework-2

Conversation

@zoontek

@zoontek zoontek commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Part 2 of 3 of the I18nManager rework (RFC, split from #59404). Depends on #60458, review the last commit only.

  • Removes the native left / right swap. left / right are always physical, like on the web. Use start / end for direction-aware styles.
  • JS still reads doLeftAndRightSwapInRTL when native sends it, so a new JS bundle running on an older binary keeps compensating for the swap (SafeAreaView, element inspector).
  • Reads RTL support from app configuration: new RCTSupportsRTL key in Info.plist on iOS (false when missing), android:supportsRtl on Android (unchanged).
  • Deprecates allowRTL, swapLeftAndRightInRTL and doLeftAndRightSwapInRTL (no-ops with a warning).

Changelog:

[GENERAL] [BREAKING] - Stop swapping left / right styles in RTL, use start / end instead
[GENERAL] [DEPRECATED] - Deprecate I18nManager.allowRTL, I18nManager.swapLeftAndRightInRTL and I18nManager.doLeftAndRightSwapInRTL
[IOS] [BREAKING] - Require RCTSupportsRTL set to true in Info.plist to enable RTL
[IOS] [REMOVED] - Remove allowRTL, isRTLAllowed, swapLeftAndRightInRTL and doLeftAndRightSwapInRTL from RCTI18nUtil
[ANDROID] [REMOVED] - Remove allowRTL, swapLeftAndRightInRTL and doLeftAndRightSwapInRTL from I18nUtil

Test Plan:

Flow, Jest (I18nManager-test.js), the generated TypeScript and C++ API snapshots, and the format checks pass.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 2, 2026
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant