{"id":75,"date":"2025-05-07T00:00:00","date_gmt":"2025-05-06T15:00:00","guid":{"rendered":"https:\/\/pusyuuwanko.com\/wordpress\/?p=75"},"modified":"2026-10-09T20:17:47","modified_gmt":"2026-10-09T11:17:47","slug":"jsx%e3%81%a3%e3%81%bd%e3%81%8f%e8%a6%8b%e3%81%88%e3%82%8b%e3%82%a2%e3%83%ad%e3%83%bc%e9%96%a2%e6%95%b0%e3%81%ae%e6%9b%b8%e3%81%8d%e6%96%b9%e3%81%af-vanilla-js-%e3%81%a7%e3%82%82%e4%bd%bf%e3%81%88","status":"publish","type":"post","link":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/2025\/05\/07\/jsx%e3%81%a3%e3%81%bd%e3%81%8f%e8%a6%8b%e3%81%88%e3%82%8b%e3%82%a2%e3%83%ad%e3%83%bc%e9%96%a2%e6%95%b0%e3%81%ae%e6%9b%b8%e3%81%8d%e6%96%b9%e3%81%af-vanilla-js-%e3%81%a7%e3%82%82%e4%bd%bf%e3%81%88\/","title":{"rendered":"JSX\u3063\u307d\u304f\u898b\u3048\u308b\u30a2\u30ed\u30fc\u95a2\u6570\u306e\u66f8\u304d\u65b9\u306f Vanilla JS \u3067\u3082\u4f7f\u3048\u308b"},"content":{"rendered":"<h2>\u2705 \u6982\u8981<\/h2>\n<p>React\uff08\u3084Next.js\uff09\u306e\u5f71\u97ff\u3067\u300cJSX\u3063\u307d\u3044\u69cb\u6587\u306fReact\u3060\u3051\u306e\u3082\u306e\u300d\u3068\u601d\u308f\u308c\u304c\u3061\u3067\u3059\u304c\u3001\u5b9f\u306f\u3053\u308c\u306fES6\uff08JavaScript\u306e\u6a19\u6e96\u4ed5\u69d8\uff09\u306b\u57fa\u3065\u3044\u305f\u66f8\u304d\u65b9\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u70b9\u306b\u3064\u3044\u3066\u6574\u7406\u3057\u3066\u3044\u304d\u307e\u3059\uff1a<\/p>\n<ul>\n<li>JSX\u98a8\u30a2\u30ed\u30fc\u95a2\u6570\u306e\u6b63\u4f53<\/li>\n<li>\u5373\u6642\u95a2\u6570\uff08IIFE\uff09\u3068\u306e\u9055\u3044<\/li>\n<li>\u4e09\u9805\u6f14\u7b97\u5b50\u3084\u95a2\u6570\u306e\u30cd\u30b9\u30c8\u306e\u5fdc\u7528\u4f8b<\/li>\n<\/ul>\n<hr \/>\n<h2>\u2705 \u30a2\u30ed\u30fc\u95a2\u6570\u306e\u57fa\u672c\u3068\u201cJSX\u98a8\u201d\u66f8\u304d\u65b9<\/h2>\n<pre><code class=\"language-js\">const add = (a, b) =&gt; (\n  a + b\n);<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u300c\u6ce2\u30ab\u30c3\u30b3 <code>{}<\/code> \u3067\u306f\u306a\u304f\u4e38\u30ab\u30c3\u30b3 <code>()<\/code>\u300d\u3067\u56f2\u3080\u3053\u3068\u3067\u3001<strong>\u660e\u793a\u7684\u306a <code>return<\/code> \u3092\u7701\u7565\u3057\u3066\u5024\u3092\u8fd4\u3059<\/strong>\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>NG\u30d1\u30bf\u30fc\u30f3\uff08\u69cb\u6587\u30a8\u30e9\u30fc\uff09:<\/h3>\n<pre><code class=\"language-js\">const add = (a, b) =&gt; (\n  let result = a + b;\n  result + 1;\n);\n\/\/ SyntaxError<\/code><\/pre>\n<blockquote>\n<p><code>()<\/code> \u3067\u56f2\u307e\u308c\u308b\u306e\u306f\u300c\u5f0f(expression)\u300d\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\n<code>let<\/code> \u3084 <code>if<\/code> \u306f\u300c\u6587(statement)\u300d\u306a\u306e\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u2705 \u4e09\u9805\u6f14\u7b97\u5b50\u3084\u6539\u884c\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/h2>\n<pre><code class=\"language-js\">const add = (a, b) =&gt; (\n  a &gt; 0\n    ? a + b\n    : 0\n);<\/code><\/pre>\n<p>\u53ef\u8aad\u6027\u3082\u9ad8\u304f\u3001JSX\u306e\u4e2d\u3067\u3082\u3088\u304f\u4f7f\u308f\u308c\u308b\u5f62\u3067\u3059\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u5373\u6642\u95a2\u6570\u3068\u306e\u9055\u3044<\/h2>\n<pre><code class=\"language-js\">(() =&gt; {\n  console.log(\"\u3053\u308c\u306f\u5373\u6642\u95a2\u6570\uff08IIFE\uff09\");\n})();<\/code><\/pre>\n<p>JSX\u98a8\u306e <code>(() =&gt; ())<\/code> \u3068\u306f\u5225\u7269\u3067\u3001<strong>\u5b9a\u7fa9\u3057\u3066\u3059\u3050\u306b\u5b9f\u884c\u3055\u308c\u308b\u95a2\u6570<\/strong>\u3067\u3059\u3002<br \/>\n\u4e2d\u8eab\u304c\u8907\u96d1\u306b\u306a\u308b\u3068 <code>{}<\/code> \u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u307e\u3068\u3081<\/h2>\n<ul>\n<li>JSX\u98a8\u30a2\u30ed\u30fc\u95a2\u6570\u306f\u3001\u305f\u3060\u306eES6\u306e\u69cb\u6587<\/li>\n<li><code>()<\/code> \u306f <strong>1\u884c\u306e\u5024\uff08\u5f0f\uff09\u3060\u3051\u3092\u8fd4\u3059<\/strong>\u3068\u304d\u306b\u4f7f\u3048\u308b<\/li>\n<li><code>let<\/code> \u3084 <code>if<\/code> \u3092\u4f7f\u3044\u305f\u3044\u3068\u304d\u306f <code>{}<\/code> \u304c\u5fc5\u8981<\/li>\n<li>JSX\u3067\u4f7f\u308f\u308c\u308b\u69cb\u6587\u306f\u3001\u5b9f\u306fVanilla JS\u3067\u3082\u4f7f\u3048\u308b\uff01<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3075\u3068\u3001\u4f8b\u3048\u3070forEach(() => {})\u3068\u3044\u3046\u66f8\u304d\u65b9\u304c\u4e00\u822c\u7684\u306a\u306e\u306bjsx\u3067HTML\u5185\u306b\u66f8\u304f\u3068forEach(() => ())\u3053\u306e\u3088\u3046\u306b{}\u3092()\u3067\u66f8\u304f\u306e\u306b\u7591\u554f\u3092\u611f\u3058\u305f\u306e\u3067\u305d\u306e\u7406\u7531\u3068\u305d\u308c\u3092\u30d0\u30cb\u30e9JS\u3067\u3082\u66f8\u3051\u308b\u306e\u304b\u691c\u8a3c\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/p-blog.pusyuuwanko.com\/index.php\/2025\/05\/07\/jsx%e3%81%a3%e3%81%bd%e3%81%8f%e8%a6%8b%e3%81%88%e3%82%8b%e3%82%a2%e3%83%ad%e3%83%bc%e9%96%a2%e6%95%b0%e3%81%ae%e6%9b%b8%e3%81%8d%e6%96%b9%e3%81%af-vanilla-js-%e3%81%a7%e3%82%82%e4%bd%bf%e3%81%88\/\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-isami-service"],"_links":{"self":[{"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":1,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-blog.pusyuuwanko.com\/index.php\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}