2

I am using a state to store the text and update it as typed. The value of the TextInput is then changed as the state is changed. This works as a packaged app but not in a an ios browser. Please let me know if there is a better way to implement this or make it work. Thank you.

const function1 = (props) => {
        
const [text, setText] = useState("");
        
return (
    <View>
        <TextInput
            style={styles.textInput}
            onChangeText={(t) => setText(t)}
            placeholder="placeholder..."
            value={text}
            autoCorrect={false}
            autoCapitalize="words"
            onSubmitEditing={() => {
              doSomething(text);
              setText("");
            }}
          />
    <View/>
        
    );
};
chris67x
  • 33
  • 4

0 Answers0