diff --git a/packages/react-native/Libraries/Modal/Modal.js b/packages/react-native/Libraries/Modal/Modal.js index dc855add3d06..c0b1b4e7ad77 100644 --- a/packages/react-native/Libraries/Modal/Modal.js +++ b/packages/react-native/Libraries/Modal/Modal.js @@ -22,7 +22,6 @@ import * as React from 'react'; const ScrollView = require('../Components/ScrollView/ScrollView').default; const View = require('../Components/View/View').default; const AppContainer = require('../ReactNative/AppContainer').default; -const I18nManager = require('../ReactNative/I18nManager').default; const {RootTagContext} = require('../ReactNative/RootTag'); const StyleSheet = require('../StyleSheet/StyleSheet').default; @@ -367,17 +366,13 @@ class Modal extends React.Component { } } -const side = I18nManager.getConstants().isRTL ? 'right' : 'left'; const styles = StyleSheet.create({ modal: { position: 'absolute', }, - /* $FlowFixMe[incompatible-type] Natural Inference rollout. See - * https://fburl.com/workplace/6291gfvu */ container: { - // $FlowFixMe[incompatible-type] - [side]: 0, top: 0, + start: 0, flex: 1, backgroundColor: 'white', }, diff --git a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js index 34e268d2442a..68c6d1762455 100644 --- a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js +++ b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js @@ -19,7 +19,12 @@ import {createRef} from 'react'; import {Modal} from 'react-native'; const DEFAULT_MODAL_CHILD_VIEW = ( - + ); describe('', () => { diff --git a/packages/rn-tester/js/examples/RTL/RTLExample.js b/packages/rn-tester/js/examples/RTL/RTLExample.js index 7f0d8453ea65..e7ecb1e1d093 100644 --- a/packages/rn-tester/js/examples/RTL/RTLExample.js +++ b/packages/rn-tester/js/examples/RTL/RTLExample.js @@ -124,7 +124,7 @@ const IconsExample = withRTLState(({isRTL, setRTL}) => { Without directional meaning - + { @@ -349,8 +349,8 @@ const PaddingExample = withRTLState(({isRTL, setRTL}) => { backgroundColor: 'white', paddingTop: 5, paddingBottom: 5, - borderLeftWidth: 1, - borderRightWidth: 1, + borderStartWidth: 1, + borderEndWidth: 1, borderColor: 'gray', }}> @@ -383,8 +383,8 @@ const MarginExample = withRTLState(({isRTL, setRTL}) => { paddingBottom: 5, marginStart: 50, marginEnd: 10, - borderLeftWidth: 1, - borderRightWidth: 1, + borderStartWidth: 1, + borderEndWidth: 1, borderColor: 'gray', }}> @@ -484,8 +484,8 @@ const BorderColorExample = withRTLState(({isRTL, setRTL}) => { style={{ borderStartColor: 'red', borderEndColor: 'green', - borderLeftWidth: 20, - borderRightWidth: 20, + borderStartWidth: 20, + borderEndWidth: 20, padding: 10, }}> @@ -681,16 +681,16 @@ const styles = StyleSheet.create({ switchRowSwitchView: { flex: 3, }, - rightAlignStyle: { - right: 10, + endAlignStyle: { + end: 10, position: 'absolute', }, list: { height: 120, marginBottom: 5, borderTopWidth: 0.5, - borderLeftWidth: 0.5, - borderRightWidth: 0.5, + borderStartWidth: 0.5, + borderEndWidth: 0.5, borderColor: '#e5e5e5', }, row: { @@ -720,7 +720,7 @@ const styles = StyleSheet.create({ transform: [{scaleX: IS_RTL ? -1 : 1}], }, image: { - left: 30, + start: 30, width: 48, height: 48, }, @@ -750,11 +750,11 @@ const styles = StyleSheet.create({ fontSizeExtraSmall: { fontSize: 8, }, - textAlignLeft: { - textAlign: 'left', + textAlignStart: { + textAlign: 'start', }, - textAlignRight: { - textAlign: 'right', + textAlignEnd: { + textAlign: 'end', }, textBox: { width: 28, @@ -805,34 +805,34 @@ exports.examples = [ }, }, { - title: "Using textAlign: 'left'", + title: "Using textAlign: 'start'", description: ('In iOS/Android, text alignment flips regardless of ' + 'languages or text content.') as string, render: function (): React.MixedElement { return ( ); }, }, { - title: "Using textAlign: 'right'", + title: "Using textAlign: 'end'", description: ('In iOS/Android, text alignment flips regardless of ' + 'languages or text content.') as string, render: function (): React.MixedElement { return ( ); }, }, { - title: "Using textAlign: 'right' for TextInput", + title: "Using textAlign: 'end' for TextInput", description: 'Flip TextInput direction to RTL' as string, render: function (): React.MixedElement { - return ; + return ; }, }, {