简体   繁体   English

我目前正在学习反应,我遇到了错误。 TypeError:无法读取未定义的属性“图像”

[英]I am currently learning react and I ran into error. TypeError: Cannot read property 'image' of undefined

I have tried everything but idk why is this happening.我已经尝试了一切,但我不知道为什么会发生这种情况。 please help请帮忙

Your question description didn't have property 'image', But I guess you follow this can be sol:您的问题描述没有属性“图像”,但我想您可以遵循以下方法:

import image from './yourImageName.png'; // Tell webpack this JS file uses this image

.png can replace as.jpg... whatever you want. .png 可以替换 as.jpg... 任何你想要的。 It's your file extension.这是你的文件扩展名。

You can read this to a more clear concept您可以将阅读为更清晰的概念

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试从数据库中获取 map mydata 但我收到此错误。 TypeError:无法读取未定义的属性“地图” - I am trying to map mydata from the database but i am getting this error. TypeError: Cannot read property 'map' of undefined TypeError:无法读取未定义的属性“名称”。 我找不到出现此错误的原因。 我使用 mysql、nodejs 和 ejs 作为视图引擎 - TypeError: Cannot read property 'name' of undefined. I cannot find the reason why I get this error. I am using mysql, nodejs and ejs as view engine 我收到此错误 => TypeError: Cannot read property 'image' of undefined - I got this error => TypeError: Cannot read property 'image' of undefined 我试图 map 数据库中的数据并收到此错误。 TypeError:无法读取未定义的属性“地图” - I trying to map the data from the database and getting this error. TypeError: Cannot read property 'map' of undefined 为什么会出现“ TypeError:无法读取未定义的属性” props”(反应路由器,React-Redux)? - Why am I getting 'TypeError: Cannot read property 'props' of undefined' (react-router, React-Redux)? TypeError:无法读取未定义的属性'addTopic'。 我是盲人吗? - TypeError: Cannot read property 'addTopic' of undefined. Am I blind? 我为什么会收到TypeError:无法读取未定义的属性“现在” - Why am I getting TypeError: Cannot read property 'now' of undefined 为什么我收到 TypeError:无法读取未定义的属性“执行” - Why am I receiving TypeError: cannot read property 'execute' of undefined 为什么我收到“ TypeError:无法读取未定义的属性” length” - Why am I getting 'TypeError: Cannot read property 'length' of undefined' 我有一个类型错误:无法读取未定义的属性“GoogleAuthProvider”?(React JS)Firebase? - I am having a TypeError: Cannot read property 'GoogleAuthProvider' of undefined?(React JS) Firebase?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM