From f8ed5b7e1793b970e00bd2961ef25ca73fcd0742 Mon Sep 17 00:00:00 2001 From: Edu Date: Thu, 10 Oct 2024 12:56:25 +0200 Subject: [PATCH] Fixed TextInput Examples --- .../js/examples/TextInput/ExampleTextInput.js | 79 ++++--------------- .../TextInput/TextInputExample.ios.js | 28 ------- 2 files changed, 17 insertions(+), 90 deletions(-) diff --git a/packages/rn-tester/js/examples/TextInput/ExampleTextInput.js b/packages/rn-tester/js/examples/TextInput/ExampleTextInput.js index e7866beabfd856..635529801f7410 100644 --- a/packages/rn-tester/js/examples/TextInput/ExampleTextInput.js +++ b/packages/rn-tester/js/examples/TextInput/ExampleTextInput.js @@ -10,17 +10,8 @@ */ import {RNTesterThemeContext} from '../../components/RNTesterTheme'; -import React, {forwardRef, useContext, useState} from 'react'; -import { - StyleSheet, - View, - TextInput, - Button, - Text, - TouchableOpacity, - Clipboard, - Alert, -} from 'react-native'; +import React, {forwardRef, useContext} from 'react'; +import {StyleSheet, TextInput} from 'react-native'; const ExampleTextInput: React.AbstractComponent< React.ElementConfig, @@ -28,68 +19,32 @@ const ExampleTextInput: React.AbstractComponent< ...React.ElementRef, |}>, > = forwardRef((props, ref) => { - const [inputText, setInputText] = useState(''); - const [displayText, setDisplayText] = useState(''); - - const handleSend = () => { - setDisplayText(inputText); - setInputText(''); - }; - - const handleLongPress = () => { - Clipboard.setString(displayText); - Alert.alert('Copied to Clipboard', displayText); - }; + const theme = useContext(RNTesterThemeContext); return ( - - -