/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow */ 'use strict'; import type {RNTesterModule} from '../../types/RNTesterTypes'; import TextLegend from '../../components/TextLegend'; import TextInlineViewsExample from './TextInlineViewsExample'; const TextInlineView = require('../../components/TextInlineView'); const React = require('react'); const { Button, LayoutAnimation, Platform, Text, TextInput, View, } = require('react-native'); const TextAncestor = require('react-native/Libraries/Text/TextAncestor'); // TODO: Is there a cleaner way to flip the TextAncestor value to false? I // suspect apps won't even be able to leverage this workaround because // TextAncestor is not public. /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's * LTI update could not be added via codemod */ function InlineView(props) { return ( ); } type TextAlignExampleRTLState = {| isRTL: boolean, |}; class TextAlignRTLExample extends React.Component< {}, TextAlignExampleRTLState, > { constructor(...args: Array) { super(...args); this.state = { isRTL: false, }; } render(): React.Node { const {isRTL} = this.state; const toggleRTL = () => this.setState({isRTL: !isRTL}); return ( auto (default) - english LTR {'\u0623\u062D\u0628 \u0627\u0644\u0644\u063A\u0629 ' + '\u0627\u0644\u0639\u0631\u0628\u064A\u0629 auto (default) - arabic RTL'} left left left left left left left left left left left left left left left center center center center center center center center center center center right right right right right right right right right right right right right justify: this text component{"'"}s contents are laid out with "textAlign: justify" and as you can see all of the lines except the last one span the available width of the parent container.