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

React Native - TextInput value using ref (Uncontrolled Component)

$
0
0

I wanna know if its possible to get the value from a TextInput using its ref, like this:

emailRef = useRef<TextInput>();return(<><TextInput ref={emailRef}/><TouchableOpacity            onPress={() => console.log(emailRef.current.value)}>           Print Value of TextInput</TouchableOpacity></>)

I know this is possible on React, but i don't get how to do this on React Native

obs: I don't wanna use State to do this.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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