Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

When entering value into TextInput the keyboard closes immediatly

$
0
0

As soon as i try to enter a value into my TextInput the keyboard on mobile closes and the value is not displayed in the TextField. This happens as soon as i use the useState hook to save the input in a variable.

Is there a way to remove this behaviour? I am using ReactNative in TypeScript

const [login, setLogin] = useState("");<TextInput style={styles.text} onChangeText={setLogin} />

These should be the relevant code lines

Wanted behaviour would obviously be to be able to fill in the whole input instead of a single character and have it displayed correctly

EDIT: using the defaultValue prop fixed the displaying of the input. The closing keyboard still is a thing!


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>