Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript TypeError:undefined不是对象(正在计算';navigation.state.params.currentRoutine';)?_Javascript_Css_Reactjs_React Native_Jsx - Fatal编程技术网

Javascript TypeError:undefined不是对象(正在计算';navigation.state.params.currentRoutine';)?

Javascript TypeError:undefined不是对象(正在计算';navigation.state.params.currentRoutine';)?,javascript,css,reactjs,react-native,jsx,Javascript,Css,Reactjs,React Native,Jsx,出于某种原因,我一直收到这样的错误:“TypeError:undefined不是一个对象(评估'navigation.state.params.currentRoutine')”。this.props.navigation.navigate('ParentRoutines')) 当我尝试导航到ParentRoutine时,它会显示错误,我还有一个名为login的登录页面,导航到它时不会出现错误。parentScreen包含文件ParentRoutines,我不确定是否有其他方法导航到它 imp

出于某种原因,我一直收到这样的错误:“TypeError:undefined不是一个对象(评估'navigation.state.params.currentRoutine')”。this.props.navigation.navigate('ParentRoutines')) 当我尝试导航到ParentRoutine时,它会显示错误,我还有一个名为login的登录页面,导航到它时不会出现错误。parentScreen包含文件ParentRoutines,我不确定是否有其他方法导航到它

import React,{Component}来自'React';
//从“react native”导入{View,Alert}
进口{
警觉的,
按钮
看法
图像背景,
形象,,
文本输入,
尺寸,
样式表,
}从“反应本机”;
const{width:width}=Dimensions.get('window')
const userInfo={username:'admin',password:'1234'}
导出默认类ParentPassword扩展组件
{静态导航选项=({navigation})=>({
标题:`Parent Authentication`,
headerTitleStyle:{textAlign:'center',alignSelf:'center'},
头型:{
背景颜色:“白色”,
},
});
建造师(道具){
超级(道具)
此.state={
用户名:“”,
密码:“”,
};
}
render(){
返回(
{/*用户名和密码表单的容器*/}
{/*用户名格式*/}
this.setState({username})}
值={this.state.username}
autoCapitalize=“无”
占位符textcolor=“黑色”
underlineColorAndroid=“透明”
/>
{/*密码格式*/}
this.setState({password})}
值={this.state.password}
占位符textcolor=“黑色”
//underlineColorAndroid=“透明”
/>
);
}
_login=async()=>{
if(userInfo.username==this.state.username&&userInfo.password==this.state.password){
this.props.navigation.navigate('ParentRoutines'))
}否则{
警报('用户名或密码不正确');
}
}
}
const styles=StyleSheet.create({
用户登录信息:{
宽度:宽度-300,
身高:45,
边界半径:15,
边框样式:“实心”,
边框颜色:“#d6d7da”,
边界宽度:2,
尺寸:10,
marginBottom:20,
颜色:'黑色',
marginBottom:5,
溢出:“隐藏”,
flexDirection:'行',
对齐自我:“中心”,
},
占位符:{
颜色:“黑色”
},
标志:{
对齐内容:“中心”
},
按钮容器:{
},
登录按钮:{
玛金托普:20,
宽度:50,
自我定位:“中心”
},
登录容器:{
marginBottom:40,
玛金托普:20,
},
登录:{
填充:12,
差额:5,
身高:20,
宽度:20,
不透明度:.2,
对齐项目:“居中”,
},
背景容器:{
弹性:1,
宽度:空,
高度:空,
为内容辩护:“中心”,
对齐项目:“居中”,
},
输入:{
宽度:宽度-110,
身高:35,
边界半径:5,
尺寸:10,
paddingLeft:45,
边框宽度:0.5,
颜色:'黑色',
背景颜色:“白色”,
边框样式:“实心”,
边框颜色:“#d6d7da”,
边框宽度:4,
marginBottom:6,
溢出:“隐藏”,
},
标识容器:{
玛金托普:100,
对齐项目:“中心”
},
放弃密码:{
尺寸:16,
字母间距:.3,
线高:38,
对齐自我:“中心”,
颜色:“蓝色”,
},
一般文字:{
paddingTop:30,
尺寸:16,
线高:38,
textAlign:'中心',
颜色:'黑色',
},
创建帐户:{
尺寸:16,
线高:38,
textAlign:'中心',
颜色:“#223a7a”,
textDecorationLine:“下划线”,
},

});请向我们提供完整代码。如果您添加代码示例(出错的地方),我们可能会帮助您。请向我们提供完整代码。如果您添加代码示例(出错的地方),我们可能会帮助您。