{"id":2574,"date":"2018-11-26T02:35:30","date_gmt":"2018-11-25T17:35:30","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2574"},"modified":"2018-11-26T02:35:30","modified_gmt":"2018-11-25T17:35:30","slug":"%e3%81%9f%e3%81%a3%e3%81%9f2%e3%82%b9%e3%83%86%e3%83%83%e3%83%97%ef%bc%81react-js-%e3%81%a7%e9%81%b8%e6%8a%9e%e7%94%bb%e5%83%8f%e3%82%92%e3%83%97%e3%83%ac%e3%83%93%e3%83%a5%e3%83%bc%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2574","title":{"rendered":"\u305f\u3063\u305f2\u30b9\u30c6\u30c3\u30d7\uff01React.js \u3067\u9078\u629e\u753b\u50cf\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b\u65b9\u6cd5\uff08\u30b5\u30f3\u30d7\u30ebDL\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b<a href=\"https:\/\/blog.capilano-fw.com\/?p=2566\">Laravel\u3067\u306f\u3058\u3081\u3066\u306eReact.JS<\/a>\u3067\u306f\u6709\u540dJS\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<code>React\uff0eJS<\/code>\u3092<code>Laravel<\/code>\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3001\u7c21\u5358\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f\u30e1\u30a4\u30f3\u306e\u958b\u767a\u3067\u306f<code>Vue.js<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067<code>React.JS<\/code>\u3067\u4f55\u304b\u5c11\u3057\u5b9f\u7528\u7684\u306a\u3082\u306e\u3092\u3064\u304f\u3063\u3066\u307f\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u904e\u53bb\u306b\u597d\u8a55\u3092\u3044\u305f\u3060\u3044\u305f\u8a18\u4e8b\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1189\">\u305f\u3063\u305f2\u30b9\u30c6\u30c3\u30d7\uff01Vue.js \u3067\u9078\u629e\u753b\u50cf\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b\u65b9\u6cd5\uff08\u30b5\u30f3\u30d7\u30ebDL\u53ef\uff09<\/a>\u3068\u540c\u3058\u6a5f\u80fd\u3092<code>React.JS<\/code>\u3067\u3082\u3064\u304f\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u6700\u5f8c\u3067\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u958b\u767a\u306e\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2247 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2.png\" alt=\"\" width=\"320\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2.png 320w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-100x100.png 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/p>\n<p>\u203b \u30b3\u30f3\u30d1\u30a4\u30eb\u74b0\u5883\uff1a Laravel Mix\uff08\u8a2d\u5b9a\u65b9\u6cd5\u306f<a href=\"https:\/\/blog.capilano-fw.com\/?p=2566\">Laravel\u3067\u306f\u3058\u3081\u3066\u306eReact.JS<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff09<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<ul>\n<li>&lt;input type=&#8221;file&#8221;&gt;\u3067\u753b\u50cf\u3092\u9078\u629e\u3057\u305f\u3089\u3001\u3059\u3050\u4e0b\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/li>\n<li>\u753b\u50cf\u304c\u5909\u66f4\u306b\u306a\u3063\u305f\u3089\u30d7\u30ec\u30d3\u30e5\u30fc\u3082\u66f4\u65b0\u3059\u308b<\/li>\n<li>\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u3064\u3051\u308b<\/li>\n<\/ul>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u958b\u767a\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>\u30ec\u30a4\u30a2\u30a6\u30c8\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u306f\u3001<code>resource\/js\/components\/<\/code>\u30d5\u30a9\u30eb\u30c0\u306b<code>PreviewInput.js<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>import React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\n\nexport default class PreviewInput extends Component {\n\n    render() {\n\n        <strong>return (<\/strong>\n<strong>            &lt;div&gt;<\/strong>\n<strong>                &lt;input type=\"file\" accept=\"image\/*\" \/&gt;<\/strong>\n<strong>                &lt;div&gt;<\/strong>\n<strong>                    &lt;img src=\"\/images\/example.png\" \/&gt;<\/strong>\n<strong>                &lt;\/div&gt;<\/strong>\n<strong>            &lt;\/div&gt;<\/strong>\n<strong>        )<\/strong>\n\n    }\n\n}\n\nReactDOM.render(\n    &lt;PreviewInput \/&gt;,\n    document.getElementById('preview-input')\n);<\/pre>\n<p><code>&lt;input type=\"file\"&gt;<\/code>\u306e\u4e0b\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u30d6\u30ed\u30c3\u30af\uff08\u73fe\u5728\u306f\u76f4\u63a5\u30b5\u30f3\u30d7\u30eb\u753b\u50cf\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\uff09\u3092\u8a2d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u547c\u3073\u51fa\u3057\u5074\u306eHTML\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;html&gt;\n&lt;body&gt;\n    <strong>&lt;div id=\"preview-input\"&gt;&lt;\/div&gt;<\/strong>\n    &lt;script src=\"\/js\/app.js\"&gt;&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u3067\u306f\u4e00\u5ea6\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2578\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_1.png\" alt=\"\" width=\"262\" height=\"282\" \/><\/p>\n<h1>React.js\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u7d9a\u3044\u3066<code>React.js<\/code>\uff08JavaScript\uff09\u90e8\u5206\u3067\u3059\u3002<\/p>\n<h2>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u753b\u50cf\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u3092\u3064\u304f\u308b<\/h2>\n<p>\u307e\u305a\u306f<code>PreviewInput<\/code>\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u76f4\u5f8c\u306b<code>this.state<\/code>\u3078<code>imageData<\/code>\u3068\u3044\u3046\u540d\u524d\u306e\u5909\u6570\u3092\u4f5c\u308a\u307e\u3059\u3002\u3053\u3053\u306b\u306f\u5f8c\u307b\u3069<code>&lt;input type=\"file\"&gt;<\/code>\u3067\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u304f\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>constructor(props) {\n\n    super(props)\n\n    <strong>this.state = {<\/strong>\n<strong>        imageData: null<\/strong>\n<strong>    }<\/strong>\n\n}<\/pre>\n<h2>\u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u305d\u306e\u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306e\u30a4\u30d9\u30f3\u30c8\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5fc5\u8981\u306b\u306a\u308b\u306e\u306f<code>onChange<\/code>\u30a4\u30d9\u30f3\u30c8\u3067\u3059\u3002<br \/>\n\u3053\u306e\u4e2d\u3067<code>onFileChange()<\/code>\u3078\u30a4\u30d9\u30f3\u30c8\u5909\u6570\u3092\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>return (\n    &lt;div&gt;\n        &lt;input type=\"file\" accept=\"image\/*\" <strong>onChange={<\/strong>\n<strong>            (e) =&gt; {<\/strong>\n<strong>                this.onFileChange(e)<\/strong>\n<strong>            }<\/strong>\n<strong>        }<\/strong> \/&gt;\n        &lt;div&gt;\n            &lt;img src=\"\/images\/example.png\" \/&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n)<\/pre>\n<p>\u7d9a\u3044\u3066\u30a4\u30d9\u30f3\u30c8\u5909\u6570\u3092\u53d7\u3051\u53d6\u308b<code>onFileChange()<\/code>\u306e\u4e2d\u8eab\u3067\u3059\u3002<\/p>\n<pre>onFileChange(e) {\n\n    const files = e.target.files\n\n    if(files.length &gt; 0) {\n\n        <strong>var file = files[0]<\/strong>\n<strong>        var reader = new FileReader()<\/strong>\n<strong>        reader.onload = (e) =&gt; {<\/strong>\n\n<strong>            this.setState({ imageData: e.target.result })<\/strong>\n\n<strong>        };<\/strong>\n<strong>        reader.readAsDataURL(file)<\/strong>\n\n    } else {\n\n        <strong>this.setState({ imageData: null })<\/strong>\n\n    }\n\n}<\/pre>\n<p>\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001\u307e\u305a\u753b\u50cf\u304c\u672c\u5f53\u306b\u9078\u629e\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u3092\u30d5\u30a1\u30a4\u30eb\u6570\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3001\u3082\u3057\u9078\u629e\u3055\u308c\u3066\u3044\u305f\u3089<code>FileReader()<\/code>\u3067\u305d\u306e\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u8aad\u307f\u8fbc\u307e\u308c\u305f\u753b\u50cf\u30c7\u30fc\u30bf\u306f\u5148\u307b\u3069\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u8a2d\u5b9a\u3057\u305f<code>imageData<\/code>\u306e\u4e2d\u3078\u683c\u7d0d\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u305f\u5834\u5408\uff08\u30d5\u30a1\u30a4\u30eb\u6570\u304c\u30bc\u30ed\u306e\u3068\u304d\uff09\u306f<code>imageData<\/code>\u3092<code>null<\/code>\u3067\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u4e00\u756a\u6700\u521d\u306b\u3064\u304f\u3063\u305f<code>render()<\/code>\u306b\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>render() {\n\n    <strong>const imageData = this.state.imageData<\/strong>\n<strong>    let preview = ''<\/strong>\n\n<strong>    if(imageData != null) {<\/strong>\n\n<strong>        preview = (<\/strong>\n<strong>            &lt;div&gt;<\/strong>\n<strong>                &lt;img src={imageData}\/&gt;<\/strong>\n<strong>            &lt;\/div&gt;<\/strong>\n<strong>        )<\/strong>\n\n<strong>    }<\/strong>\n\n    return (\n        &lt;div&gt;\n            &lt;input type=\"file\" accept=\"image\/*\" onChange={\n                (e) =&gt; {\n                    this.onFileChange(e)\n                }\n            } \/&gt;\n            <strong>{preview}<\/strong>\n        &lt;\/div&gt;\n    )\n\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u307e\u305a\u3001\u753b\u50cf\u30c7\u30fc\u30bf\u304c<code>null<\/code>\u3067\u306f\u306a\u3044\uff08\u3064\u307e\u308a\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u304c\u3042\u308b\uff09\u5834\u5408\u306b<code>preview<\/code>\u3068\u3044\u3046\u5909\u6570\u306b\u753b\u50cf\u8868\u793a\u30bf\u30b0\u3092\u683c\u7d0d\u3057\u3001\u6700\u7d42\u7684\u306b<code>{preview}<\/code>\u306e\u5834\u6240\u3078\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u304d\u306f\u4f55\u3082\u8868\u793a\u305b\u305a\u3001\u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u305f\u3089\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2579\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_2.png\" alt=\"\" width=\"268\" height=\"135\" \/><\/p>\n<p>\u4eca\u56de\u306f\u5c11\u3057\u5c0f\u3055\u306a\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u753b\u50cf\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u3046\u307e\u304f\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u305f\u3089\u305d\u306e\u4e0b\u306b\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3057\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u9078\u629e\u753b\u50cf\u3092\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3068\u304d\u306b<code>&lt;input type=\"file\"&gt;<\/code>\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u5c02\u7528\u306e<code>ref<\/code>\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre>constructor(props) {\n\n    \/\/ \u7701\u7565\n    <strong>this.fileInput = React.createRef()<\/strong>\n\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u30a4\u30f3\u30d7\u30c3\u30c8\u306b<code>ref<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"file\" accept=\"image\/*\" <strong>ref={this.fileInput} ...<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u3069\u3053\u304b\u3089\u3067\u3082\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u30a4\u30f3\u30d7\u30c3\u30c8\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>render() {\n\n    \/\/ \u7701\u7565\n\n    <strong>let resetButton = ''<\/strong>\n\n    if(imageData != null) {\n\n        \/\/ \u7701\u7565\n\n        <strong>resetButton = (<\/strong>\n<strong>            &lt;div&gt;<\/strong>\n<strong>                &lt;button type=\"button\" onClick={this.resetInput.bind(this)}&gt;\u30ea\u30bb\u30c3\u30c8\u3059\u308b&lt;\/button&gt;<\/strong>\n<strong>            &lt;\/div&gt;<\/strong>\n<strong>        )<\/strong>\n\n    }\n\n    return (\n        &lt;div&gt;\n            &lt;!--\u7701\u7565--&gt;\n            {preview}\n            <strong>{resetButton}<\/strong>\n        &lt;\/div&gt;\n    )\n\n}<\/pre>\n<p>\u307e\u305a\u3001\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570<code>resetButton<\/code>\u3092\u4f5c\u308a\u3001\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3068\u540c\u3058\u304f\u753b\u50cf\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\u3060\u3051\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u306b\u306f\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u3067<code>resetInput()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u304c<code>.bind(this)<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002\u3053\u308c\u306f\u3001<code>resetInput()<\/code>\u5185\u3067<code>this<\/code>\u3092\u53c2\u7167\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u6700\u5f8c\u306b<code>resetInput()<\/code>\u306e\u4e2d\u8eab\u3067\u3059\u3002<\/p>\n<pre>resetInput() {\n\n    <strong>this.fileInput.current.value = ''<\/strong>\n<strong>    this.setState({ imageData: null })<\/strong>\n\n}<\/pre>\n<p><code>this.fileInput.current<\/code>\u304c\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u30a4\u30f3\u30d7\u30c3\u30c8\u306a\u306e\u3067\u3001<code>value<\/code>\u3092\u7a7a\u767d\u306b\u3057\u3066\u30af\u30ea\u30a2\u3002\u305d\u3057\u3066\u3001\u3053\u308c\u3060\u3051\u3067\u306f\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u306f\u8868\u793a\u3055\u308c\u305f\u307e\u307e\u306a\u306e\u3067\u3001<code>setState()<\/code>\u3067\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2580\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_3.png\" alt=\"\" width=\"230\" height=\"35\" \/><\/p>\n<p>\u307e\u305a\u306f\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u30a4\u30f3\u30d7\u30c3\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u30af\u30ea\u30c3\u30af\u3057\u3066\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u958b\u304d\u753b\u50cf\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2581\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_4.png\" alt=\"\" width=\"625\" height=\"463\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_4.png 625w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_4-300x222.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30a4\u30f3\u30d7\u30c3\u30c8\u306e\u4e0b\u306b\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3068\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u304c\u305d\u308c\u305e\u308c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2582\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_5.png\" alt=\"\" width=\"260\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_5.png 260w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_5-258x300.png 258w\" sizes=\"auto, (max-width: 260px) 100vw, 260px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30ea\u30bb\u30c3\u30c8\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30af\u30ea\u30a2\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2580\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/react_preview_input_3.png\" alt=\"\" width=\"230\" height=\"35\" \/><\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff01<\/p>\n<h1>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u3061\u306a\u307f\u306bIE 11\u3067\u3082\u78ba\u8a8d\u6e08\u3067\u3059\uff09<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001Laravel Mix\u306a\u3069\u30b3\u30f3\u30d1\u30a4\u30eb\u8a2d\u5b9a\u306f\u3054\u81ea\u8eab\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=2585&amp;tmstv=1777531474\" rel=\"nofollow\" id=\"download-link-2585\" data-redirect=\"false\" >\n\tReact.js \u3067\u9078\u629e\u753b\u50cf\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>React<\/code>\u3067\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3060React\u306b\u306f\u6163\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u96d1\u611f\u3068\u3057\u3066\u306f<code>Vue<\/code>\u3088\u308a\u66f8\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u30b3\u30fc\u30c9\u304c\u5c11\u3057\u591a\u3044\u304b\u306a\u30fc\u3001\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3001\u3084\u306f\u308a\u30b3\u30fc\u30c9\u304c\u3072\u3068\u3064\u3072\u3068\u3064\u5206\u5272\u3055\u308c\u3066\u3044\u308b\u69cb\u6210\u306a\u306e\u3067\u53ef\u8aad\u6027\u306f\u3044\u3044\u3067\u3059\u3057\u3001\u3084\u306f\u308a\u30d0\u30fc\u30c1\u30e3\u30ebdom\u3068\u3044\u3046\u8003\u3048\u65b9\u3082\u9769\u65b0\u7684\u3060\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060React\u306e\u63a2\u6c42\u306f\u7d9a\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u305c\u3072\u3054\u671f\u5f85\u4e0b\u3055\u3044\uff01<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2158 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png\" alt=\"\" width=\"170\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png 170w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29-159x300.png 159w\" sizes=\"auto, (max-width: 170px) 100vw, 170px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8bLaravel\u3067\u306f\u3058\u3081\u3066\u306eReact.JS\u3067\u306f\u6709\u540dJS\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30afReact\uff0eJS\u3092Laravel\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3001\u7c21\u5358\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2574\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u305f\u3063\u305f2\u30b9\u30c6\u30c3\u30d7\uff01React.js \u3067\u9078\u629e\u753b\u50cf\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3059\u308b\u65b9\u6cd5\uff08\u30b5\u30f3\u30d7\u30ebDL\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2591,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[118],"tags":[84,83],"class_list":["post-2574","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-js","tag-84","tag-83"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2574"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2574\/revisions"}],"predecessor-version":[{"id":2592,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2574\/revisions\/2592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2591"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}