Skip to content

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

react-native-live-direction

Switch the native layout direction (RTL/LTR) at runtime, without restarting the app.

This repository contains:

  • packages/live-direction — the react-native-live-direction package: Expo config plugin, Metro resolver shim, Android/iOS native module, and Expo Router helpers.
  • src/ — a React Navigation demo (native stack + bottom tabs) with English/Arabic content, translated headers, and a live language switch.

Run the demo

The native module requires a development build:

npm install
npx expo run:android   # or: npx expo run:ios

metro.config.js wraps the config with withLiveDirection, and the config plugin is registered in app.json.

Package

Install:

npx expo install react-native-live-direction

Add the plugin and Metro wrapper as described in the package README.

Expo Router helpers are available from the expo-router subpath:

import {
  LiveDirectionProvider,
  LiveNativeTabs,
} from 'react-native-live-direction/expo-router';

LiveDirectionProvider wraps the Stack and uses expo-router's LocaleProvider (requires expo-router >= 57.0.28). LiveNativeTabs forwards the current direction to native tabs.

How it works

I18nManager.forceRTL() only applies on the next app start because React Native bakes direction into the surface at creation and caches the JS constants at import. The package re-constrains the native surface in place, keeps I18nManager live through a Metro shim, and exposes setDirection() so Yoga, native headers, tab bars, and modals flip immediately.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages