{"id":8237,"date":"2022-06-06T06:07:13","date_gmt":"2022-06-05T21:07:13","guid":{"rendered":"https:\/\/yumishin.com\/?p=8237"},"modified":"2022-06-06T06:07:13","modified_gmt":"2022-06-05T21:07:13","slug":"react-styled-components","status":"publish","type":"post","link":"https:\/\/yumishin.com\/?p=8237","title":{"rendered":"\u3010React, styled-components\u3011The above error occurred in the <img> component\u3078\u306e\u5bfe\u51e6"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h2 id=\"i-0\">\u3010React, styled-components\u3011The above error occurred in the &lt;img&gt; component\u3078\u306e\u5bfe\u51e6<\/h2>\n<h3 id=\"i-1\">\u30a8\u30e9\u30fc\u5185\u5bb9<\/h3>\n<ul>\n<li>React\u3068styled-components\u3067\u30c7\u30b6\u30a4\u30f3\u3092\u4f5c\u3063\u3066\u3044\u305f\u6642\u306e\u3053\u3068<\/li>\n<li>\u30da\u30fc\u30b8\u3092\u8868\u793a\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u3001\u771f\u3063\u767d\u306a\u753b\u9762\u3057\u304b\u8868\u793a\u3055\u308c\u306a\u3044<\/li>\n<li>developer tool\u306b\u3066\u3001\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u305f<\/li>\n<\/ul>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> developer tool\u306econsole\u753b\u9762<\/span><\/p>\n<pre><code>The above error occurred in the <img>&lt;img&gt; component:\n\n    at img\n    at O (http:\/\/localhost:3001\/static\/js\/vendors~main.chunk.js:71248:6)\n    at div\n    at O (http:\/\/localhost:3001\/static\/js\/vendors~main.chunk.js:71248:6)\n    at div\n    at O (http:\/\/localhost:3001\/static\/js\/vendors~main.chunk.js:71248:6)\n    at div\n    at O (http:\/\/localhost:3001\/static\/js\/vendors~main.chunk.js:71248:6)\n    at Home (http:\/\/localhost:3001\/static\/js\/main.chunk.js:8060:86)<\/code><\/pre>\n<\/div>\n<ol>\n<li>\u76f4\u8a33\u3059\u308b\u3068\u3001<code>&lt;img&gt;\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f<\/code>\u3068\u3044\u3046\u3053\u3068<\/li>\n<li>\u30a8\u30e9\u30fc\u767a\u751f\u7b87\u6240\u306e\u60c5\u5831\u304c\u306e\u3063\u3066\u3044\u306a\u304b\u3063\u305f<\/li>\n<li>\u305f\u3060\u3001\u767d\u98db\u3073\u3057\u3066\u3044\u308b\u30da\u30fc\u30b8\u306b\u3066\u3001\u56f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u9650\u3089\u308c\u3066\u3044\u305f\u306e\u3067\u3001\u305d\u306e\u8fba\u308a\u3092\u8abf\u67fb<\/li>\n<li>\u5bfe\u5fdc\u3059\u308b\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b<\/li>\n<\/ol>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> styled-compornents<\/span><\/p>\n<pre><code>\n...\u7701\u7565...\nconst HeaderWrapper = styled.img`\n  display: flex;\n  justify-content: flex-start;\n  padding: 8px 32px;\n`;\n\nconst MainLogoImage = styled.div`\n  height: 90px;\n`;\n...\u7701\u7565...\n<\/code><\/pre>\n<\/div>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> jsx\u30d5\u30a1\u30a4\u30eb<\/span><\/p>\n<pre><code>\n...\u7701\u7565...\n&lt;HeaderWrapper&gt;\n  &lt;Link to='\/restaurants'&gt;\n    &lt;MainLogoImage src={Mainlog} \/&gt;\n  &lt;\/Link&gt;\n&lt;\/HeaderWrapper&gt;\n...\u7701\u7565...<\/code><\/pre>\n<\/div>\n<h3 id=\"i-2\">\u89e3\u6c7a\u65b9\u6cd5<\/h3>\n<ul>\n<li>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u3001\u30a8\u30e9\u30fc\u89e3\u6c7a<\/li>\n<li>img\u304c\u3042\u305f\u308b\u3079\u304d\u753b\u50cf\u306b\u3042\u305f\u3063\u3066\u3044\u306a\u304b\u3063\u305f\n<ul>\n<li>div\u3067\u304f\u304f\u3063\u305f\u4e2d\u306b\u3001img\u304c\u306a\u3044\u3068\u3053\u3093\u306a\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> styled-compornents<\/span><\/p>\n<pre><code>\n...\u7701\u7565...\nconst HeaderWrapper = styled.div` # img\u304b\u3089div\u3078\n  display: flex;\n  justify-content: flex-start;\n  padding: 8px 32px;\n`;\n\nconst MainLogoImage = styled.img` #div\u304b\u3089img\u3078\n  height: 90px;\n`;\n...\u7701\u7565...\n<\/code><\/pre>\n<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u3010React, styled-components\u3011The above error occurred in the &lt;img&gt; component\u3078\u306e\u5bfe\u51e6 \u30a8\u30e9\u30fc\u5185\u5bb9 React\u3068styled- &#8230; <\/p>\n","protected":false},"author":1,"featured_media":8245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[256],"tags":[],"class_list":{"0":"post-8237","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-it","8":"entry"},"_links":{"self":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/8237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8237"}],"version-history":[{"count":3,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/8237\/revisions"}],"predecessor-version":[{"id":8246,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/8237\/revisions\/8246"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/media\/8245"}],"wp:attachment":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}