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

React Native : Not able to switch to next TextInput on returnKeyType="next" using ref

$
0
0

I am trying to move the focus from one TextInput to another on keyboard next press like in the below code in typescript

But it shows "Property 'focus' does not exist on type 'never'.ts(2339)" error

Is there any other method to do the same functionality

const emailRef = React.useRef()const passwordRef = React.useRef()<TextInput     ref={emailRef }                             // Current TextInput Ref     onSubmitEditing={()=>passwordRef .current?.focus()}  // Changing focus     secureTextEntry={isSecured}     placeholder={placeHolder}     placeholderTextColor={GREY[400]}     selectionColor={GREY[900]}     style={styles.inputText}     onChangeText={onChangeText}     keyboardType={keyboardType}     onEndEditing={onEndEditing}     autoFocus={autoFocus}     returnKeyType={returnKeyType}/>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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