I have written this code, while typing inside it screen gets refreshed multiple times and the <TextInput/> component get cleared automatically.
<TextInput
onChangeText={(value) =>setsearchTerm(value) }
style={styles.searchInput}
placeholder="Type a message"
value={searchTerm}
/>