I am working on a react-native app in which I am facing a problem with the TextInput.
Whenever I press a key on the keyboard, the keyboard closes down.
I have tried using different text input components like material text input and 'react-native-elements' input. However the same issue exists.
There are similar questions on stackexchange but they are all trying to fix this problem in TextInput. However, the problem is not in the TextInput but somewhere in the implementation of TextInput.
I have simplified the code to:
import React, {useState} from 'react';
import { Text, View, StyleSheet, TextInput } from 'react-native';
const App = () => {
const [additionalComments, setAdditionalComments] = useState("");
const StarFeedback = () => {
return (
<TextInput
placeholder="Additional Comments"
onChangeText={text => setAdditionalComments(text)}
value={additionalComments}
/>
)
}
return (
<View>
<StarFeedback/>
</View>
);
};
export default App;
const styles = StyleSheet.create({
});
Link to snack: https://snack.expo.dev/@rachitkohli/634602