mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-27 22:55:56 +08:00
1. Fix auto-flipping of styles The StyleRegistry didn't account for LTR/RTL when caching the results of style resolution. The 'writingDirection' style is no longer flipped; no clear use case for it. 2. Remove experimental '$noI18n' style prop suffix This feature is essentially unused, and less likely to be used with the introduction of 'dir=auto' on 'Text'. Removing also marginally improves render performance.
689 B
689 B
Internationalization
To support right-to-left languages, application layout can be automatically
flipped from LTR to RTL. The I18nManager API can be used to help with more
fine-grained control and testing of RTL layouts.
Working with icons and images
Icons and images that must match the LTR or RTL layout of the app need to be manually flipped.
Either use a transform style:
<Image
source={...}
style={{ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }] }}
/>
Or replace the source asset:
import imageSourceLTR from './back.png';
import imageSourceRTL from './forward.png';
<Image
source={I18nManager.isRTL ? imageSourceRTL : imageSourceLTR}
/>