From a8ba38087897242e8ebc4cc9189079fdc94ca974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Fri, 11 Oct 2024 14:42:48 +0200 Subject: [PATCH 1/2] add example for dynamic sized text input --- .../TextInput/TextInputSharedExamples.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js b/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js index fbf4deb29d2c..eef27345f74f 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js @@ -846,6 +846,40 @@ function MultilineStyledTextInput({ ); } +function DynamicContentWidth() { + const [text, setText] = useState(''); + const update = () => { + const randomNumber = Math.floor(Math.random() * 10); + setText(text + randomNumber); + }; + + return ( + + Uncontrolled: + + Controlled: + +