{"id":1592,"date":"2021-08-06T17:40:03","date_gmt":"2021-08-06T08:40:03","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=1592"},"modified":"2021-08-06T20:44:31","modified_gmt":"2021-08-06T11:44:31","slug":"react%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=1592","title":{"rendered":"React\u3092\u4f7f\u3046"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">HTML\u3067React\u3092\u5229\u7528\u3059\u308b\u5834\u5408<\/h2>\n\n\n\n<p>html\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304b\u308c\u305f\u4e0b\u8a18\u30b3\u30fc\u30c9\u306funpkg.com\u3068\u3044\u3046\u30b5\u30a4\u30c8\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bReact\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306freact\u3068react-dom\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<br>\u3053\u306e\uff12\u3064\u306fReact\u306e\u3082\u3063\u3068\u3082\u57fa\u672c\u3068\u306a\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>react\uff08React\u306e\u672c\u4f53\uff09<\/li><li>react-dom\uff08React\u306e\u4eee\u60f3DOM\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\uff09<\/li><\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>    &lt;script src=&quot;https:\/\/unpkg.com\/react@17\/umd\/react.development.js&quot;&gt;&lt;\/script&gt;\n    &lt;script src=&quot;https:\/\/unpkg.com\/react-dom@17\/umd\/react-dom.development.js&quot;&gt;&lt;\/script&gt;<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-jin-gb-block-box-with-headline kaisetsu-box1\"><div class=\"kaisetsu-box1-title\">CDN<\/div>\n<p>CDN\u306f\u300cContent Delivery Network\u300d\u306e\u7565\u3067JavaScript\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306a\u3069\u3092\u30aa\u30f3\u30e9\u30a4\u30f3\u3067\u914d\u5e03\u3059\u308b\u30b5\u30a4\u30c8\u3067\u3059\u3002CDN\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067JavaScript\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u591a\u6570\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b9\u30af\u30ea\u30d7\u30c8<\/h4>\n\n\n\n<p>React\u306b\u3088\u308b\u8868\u793a\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u306e\u30bf\u30b0<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>&lt;div id=&quot;root&quot;&gt;wait...&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p>&lt;script&gt;&lt;\/script&gt;\u3067\u56f2\u307e\u308c\u305f\u90e8\u5206\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u304cReact\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>querySelector\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066id=&#8221;root&#8221;\u306e\u30bf\u30b0\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>let dom = document.querySelector(&#39;#root&#39;);<\/code><\/pre><\/div>\n\n\n\n<p>HTML\u30bf\u30b0\u306b\u3088\u308b\u8868\u793a\u3092\u3059\u308b\u305f\u3081\u306b\u30a8\u30ec\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\u30a8\u30ec\u30e1\u30f3\u30c8\u3068\u306fHTML\u306e\u30bf\u30b0\uff08&lt;p>\u30bf\u30b0\u3068\u304b&lt;div>\u30bf\u30b0\uff09\u3068\u3057\u3066\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3082\u306e\u3092JavaScript\u306e\u4e2d\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u6271\u3046\u3088\u3046\u306b\u3057\u305f\u3082\u306e\u3067\u3059\u3002<br>\u3053\u306e\u30a8\u30ec\u30e1\u30f3\u30c8\u306f\u4eee\u60f3DOM\u306e\u30a8\u30ec\u30e1\u30f3\u30c8\u3067\u3059\u3002<br>\u7b2c\u4e00\u5f15\u6570\u306b\u306f\u4f5c\u6210\u3059\u308b\u30bf\u30b0\u306e\u540d\u524d\u3092\u3001\u7b2c\u4e8c\u5f15\u6570\u306b\u306f\u30a8\u30ec\u30e1\u30f3\u30c8\u306b\u7528\u610f\u3055\u308c\u308b\u5c5e\u6027\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7528\u610f\u3057\u307e\u3059\u3002<br>\u7b2c\u4e09\u5f15\u6570\u306b\u306f\u4f5c\u6210\u3059\u308b\u30a8\u30ec\u30e1\u30f3\u30c8\u306e\u5185\u90e8\u306b\u7d44\u307f\u8fbc\u307e\u308c\u308b\u3082\u306e\u3092\u7528\u610f\u3057\u307e\u3059\u3002<br>(React.createElement(\u30bf\u30b0\u540d\u3001\u5c5e\u6027\u3001\u4e2d\u306b\u7d44\u307f\u8fbc\u307e\u308c\u308b\u3082\u306e))<\/p>\n\n\n\n<div class=\"wp-block-jin-gb-block-box-with-headline kaisetsu-box5\"><div class=\"kaisetsu-box5-title\">\u4eee\u60f3DOM<\/div>\n<p>React\u306f\u72ec\u81ea\u306bDOM\u30b7\u30b9\u30c6\u30e0\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>let element = React.createElement(\n      &#39;p&#39;, {}, &#39;Hello React!&#39;\n    )<\/code><\/pre><\/div>\n\n\n\n<p>\u4f5c\u6210\u3057\u305f\u30a8\u30ec\u30e1\u30f3\u30c8\u306fReactDOM\u3068\u3044\u3046\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306erender\u3092\u4f7f\u3063\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u307e\u3059\u3002<br>\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u3082\u3068\u306b\u5b9f\u969b\u306b\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u308b\u30c7\u30fc\u30bf(Web\u30a2\u30d7\u30ea\u306e\u5834\u5408\u306fHTML\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9)\u3092\u751f\u6210\u3059\u308b\u4f5c\u696d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u5f15\u6570\u306b\u306fcreateElement\u3067\u4f5c\u6210\u3057\u305f\u4eee\u60f3DOM\u306e\u30a8\u30ec\u30e1\u30f3\u30c8\u3001\u7b2c\u4e8c\u5f15\u6570\u306b\u306f\u305d\u308c\u3092\u306f\u3081\u8fbc\u3080\u305f\u3081\u306eDOM\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>(ReactDOM.render(\u30a8\u30ec\u30e1\u30f3\u30c8\u3001DOM))<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>ReactDOM.render(element, dom)<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"HTML\u2460\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;meta charset=&quot;UTF-8&quot; \/&gt;\n  &lt;title&gt;React&lt;\/title&gt;\n  &lt;script crossorigin src=&quot;https:\/\/unpkg.com\/react@17\/umd\/react.development.js&quot;&gt;&lt;\/script&gt;\n  &lt;script crossorigin src=&quot;https:\/\/unpkg.com\/react-dom@17\/umd\/react-dom.development.js&quot;&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;h1&gt;React&lt;\/h1&gt;\n  &lt;div id=&quot;root&quot;&gt;wait...&lt;\/div&gt;\n  &lt;script&gt;\n  let dom = document.querySelector(&#39;#root&#39;)\n  let element = React.createElement(\n    &#39;p&#39;, {}, &#39;Hello React!&#39;\n  )\n  ReactDOM.render(element, dom)\n  &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057React\u3092\u5229\u7528\u3059\u308b <\/h2>\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML\u3067React\u3092\u5229\u7528\u3059\u308b\u5834\u5408 html\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304b\u308c\u305f\u4e0b\u8a18\u30b3\u30fc\u30c9\u306funpkg.com\u3068\u3044\u3046\u30b5\u30a4\u30c8\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bReact\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306freact\u3068react-dom\u3068\u3044\u3046<\/p>\n","protected":false},"author":1,"featured_media":1593,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-1592","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1592"}],"version-history":[{"count":2,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions"}],"predecessor-version":[{"id":1597,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions\/1597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/media\/1593"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}