'Browsers on mobile iOS devices - React Native TextInput onChangeText not updating text value

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/>
        
    );
};


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source