From 78caaca768b8a8c0accfa1a589718bd7ac85229f Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 1 Jun 2021 15:58:53 -0700 Subject: [PATCH] RNTester: Text Adjusts Dynamic Layout Example Summary: Creates a new RNTester example to verify facebook/react-native#31538 (D28631465). Changelog: [Android][Added] - RNTester example for adjusting text with dynamic layout. Reviewed By: kacieb Differential Revision: D28779870 fbshipit-source-id: 5297a823645d1e9e35d4c86b491f3c225ecc9543 --- .../Text/TextAdjustsDynamicLayoutExample.js | 55 +++++++++++++++++++ .../js/examples/Text/TextExample.android.js | 5 ++ 2 files changed, 60 insertions(+) create mode 100644 packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js diff --git a/packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js b/packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js new file mode 100644 index 00000000000..d4d61260d25 --- /dev/null +++ b/packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js @@ -0,0 +1,55 @@ +/** + * Copyright (c) Facebook, Inc. and its 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 strict-local + */ + +import {Button, Text, StyleSheet, View} from 'react-native'; +import * as React from 'react'; +import {useState} from 'react'; + +export default function TextAdjustsDynamicLayoutExample(props: {}): React.Node { + const [height, setHeight] = useState(20); + + return ( + <> + + + + This is adjusting text. + + + + +