Javascript 用导航“回应本地问题”;
所以我真的很难用这个导航的东西。我不是Js或react native方面的专家,但由于使用此应用程序的人不再在公司工作,我被要求在新的人加入之前进行一些调整,但我正在努力解决这个导航问题 所以我用这个来进行双因素识别 你知道这个导航系统到底有什么用吗?如何设置它的值?它是否需要以某种方式通过它 完整代码Javascript 用导航“回应本地问题”;,javascript,reactjs,react-native,navigation,Javascript,Reactjs,React Native,Navigation,所以我真的很难用这个导航的东西。我不是Js或react native方面的专家,但由于使用此应用程序的人不再在公司工作,我被要求在新的人加入之前进行一些调整,但我正在努力解决这个导航问题 所以我用这个来进行双因素识别 你知道这个导航系统到底有什么用吗?如何设置它的值?它是否需要以某种方式通过它 完整代码 import React, {Component} from 'react' import PropTypes from 'prop-types' import { View, Text
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {
View,
Text,
TouchableHighlight,
Image,
TextInput,
} from 'react-native'
import {requiredFields} from '../helpers/forms'
import BusyButton from '../Common/BusyButton'
import DismissKeyboard from '../Common/DismissKeyboard'
import {Colors} from '../styles'
import LoginStyles from './LogInStyles'
const loginStyles = LoginStyles.createStyles()
/* eslint-disable camelcase,space-before-function-paren */
export default class TwoFactor extends Component {
static propTypes = {
screenProps: PropTypes.object.isRequired,
navigation: PropTypes.object.isRequired,
}
state = {
verificationCode: '',
}
handleSubmit = () => {
try{
const {screenProps: {auth: {sendVerificationCode}}, navigation: {navigate}} = this.props
if (requiredFields(['verificationCode'], ['Verification Code'], this.state)) {
sendVerificationCode(this.state.verificationCode,this.state.user, navigate)
}
return false
}catch(e){
console.log(e)
}
}
render() {
const {screenProps: {auth: {isFetching}}} = this.props
return (
<DismissKeyboard style={loginStyles.pageWrapper}>
<View style={loginStyles.logoContainer}>
<Image
style={loginStyles.logo}
resizeMode="contain"
source={require('../../assets/images/logo-IH_blue_gold-small.png')}
/>
</View>
<View style={loginStyles.containerExpand}>
<Text style={loginStyles.h1}>ID Verification</Text>
<Text style={loginStyles.label}>
A verification code has been sent to the phone number on file. Please enter the code below.
</Text>
<TextInput
style={loginStyles.input}
placeholder="Verification Code"
placeholderTextColor={Colors.lightGray}
onChangeText={(verificationCode) => this.setState({verificationCode})}
keyboardType="number-pad"
/>
</View>
<View style={loginStyles.container}>
<View style={loginStyles.buttonContainer}>
<BusyButton
style={loginStyles.button}
underlayColor={Colors.buttonPrimaryBkgd}
isBusy={isFetching}
onPress={this.handleSubmit}
>
<Text style={loginStyles.buttonText}>Next</Text>
</BusyButton>
</View>
</View>
</DismissKeyboard>
)
}
}
你能分享你在世博会上得到的全部代码和错误吗。到时候我会帮上忙的。我相信你输入的东西是错误的。只需分享代码。我能帮上忙是的,我更新了邮件,你能给我解释一下导航在这行中的作用吗请``sendVerificationCode(this.state.verificationCode,this.state.user,navigate)``看,通常导航是指导航到其他屏幕的东西,我猜你是把导航作为上一屏幕的道具和发送验证,您正在调用道具,它将导航到其他屏幕,可能与
it's not spitting any error, but it is not taking me to the next screen.