Reactjs ImageBackground:元素类型无效
我有这个问题。如您所见,我已经导出(使用redux)组件。我做错了什么Reactjs ImageBackground:元素类型无效,reactjs,react-native,Reactjs,React Native,我有这个问题。如您所见,我已经导出(使用redux)组件。我做错了什么 。。。 常量主体=(道具)=>{ 返回( WhatsApp克隆! modificaEmail(value)}style={{{fontSize:20,height:45}}占位符='E-mail'/> modificaSenha(value)}style={{{fontSize:20,height:45}}占位符='Senha'/> Actions.cadastar()}activeOpacity={0.3}underla
。。。
常量主体=(道具)=>{
返回(
WhatsApp克隆!
modificaEmail(value)}style={{{fontSize:20,height:45}}占位符='E-mail'/>
modificaSenha(value)}style={{{fontSize:20,height:45}}占位符='Senha'/>
Actions.cadastar()}activeOpacity={0.3}underlayColor='#F5FCFF'>
Ainda não tem地籍?地籍东南
false}/>
);
}
...
常量mapStateToProps=(状态)=>(
{
电子邮件:state.autenticacoreducer.email,
senha:state.AutenticacaoReducer.senha
}
)
导出默认连接(mapstatetops,{modificaEmail,modificaSenha})(主体);
我已经用谷歌搜索过了,但没有成功,所以,你们能帮我吗?问题是,你正在使用一个未定义的对象。因此,以下是您需要考虑的可能性:
props.email
props.senha
您可以在其中一个或两个中都未定义。您只需控制台
道具。这样你就可以了解它了
console.log(JSON.stringify(props));
您可以添加高度和宽度
希望它能帮助你 @Rahamin似乎很有钱。试一试
const PrincipalComponent = connect(mapStateToProps, { modificaEmail, modificaSenha })(Principal);
export {
PrincipalComponent as Principal
};
然后
只需在问题中键入error,而不是将其作为图像上载。问题可能存在于您未包含的导入条件中:可能是导入xxx而不是导入{xxx}。您可以发布整个文件,包括导入语句吗?控制台不会返回未定义的!我的依赖项
“依赖项”:{“react”:“16.0.0-alpha.6”,“react native”:“0.44.0”,“react native router flux”:“^3.39.1”,“react redux”:“^5.0.7”,“redux”:“^3.7.2”
如果我使用图像而不是ImageBackground,所有功能都可以,但图像不会显示。只是在我使用ImageBackground时崩溃尝试提供高度和宽度,然后检查图像。提供高度和宽度可以使用图像,但ImageBackground仍然相同。但是,谢谢,我将使用此版本的React-native.Cool的图像。我会更新我的也请回答。如果对您有帮助,您可以向上投票。仍然相同:/My dependencies“dependencies”:{“react”:“16.0.0-alpha.6”,“react native”:“0.44.0”,“react native router flux”:“^3.39.1”,“react redux”:“^5.0.7”,“redux”:“^3.7.2”
如果我使用图像而不是ImageBackground,所有操作都可以,但图像不会显示。只是在我使用ImageBackground时崩溃
const PrincipalComponent = connect(mapStateToProps, { modificaEmail, modificaSenha })(Principal);
export {
PrincipalComponent as Principal
};
import { Principal } from './Principal';