{"id":10887,"date":"2022-09-12T07:00:21","date_gmt":"2022-09-11T22:00:21","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=10887"},"modified":"2022-09-09T18:15:59","modified_gmt":"2022-09-09T09:15:59","slug":"%e3%80%90laravel%e3%80%91react-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9f%e3%83%97%e3%83%ac%e3%83%93%e3%83%a5%e3%83%bc%e7%94%bb%e5%83%8f%e5%85%a5%e5%8a%9b%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=10887","title":{"rendered":"\u3010Laravel\u3011React \u3092\u4f7f\u3063\u305f\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u5165\u529b\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\uff06\u524d\u3005\u56de\u304b\u3089<code>Vite<\/code>\u3092\u4f7f\u3063\u305f<code>React<\/code>\u306e\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u304c\u3001\u3044\u304b\u304c\u3060\u3063\u305f\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f\u9577\u3089\u304f<code>Vue<\/code>\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u307e\u3060\u307e\u3060\u52b9\u7387\u5316\u3067\u304d\u3066\u3044\u306a\u3044\u30b3\u30fc\u30c9\u304c\u3042\u308b\u304b\u3082\u3067\u3059\u304c\u3001\u305c\u3072\u540c\u3058\u3088\u3046\u306a\u5b66\u7fd2\u8005\u3055\u3093\u305f\u3061\u306b\u697d\u3057\u3093\u3067\u3044\u305f\u3060\u3051\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u3067\u3059\u304c<code>React<\/code>\u3092\u4f7f\u3063\u305f\u3089\u3084\u3063\u3066\u307f\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u305f\u3042\u308b\u6a5f\u80fd\u306b\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u753b\u50cf\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u306d\u3002<\/p>\n<ol>\n<li>\u753b\u50cf\u3092\u9078\u629e\u3059\u308b<\/li>\n<li>\u305d\u306e\u753b\u50cf\u3092\u30da\u30fc\u30b8\u306b\u8868\u793a\uff08\u753b\u50cf\u304c\u3042\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3067\u304d\u308b\uff09<\/li>\n<li>\u9078\u629e\u3057\u305f\u753b\u50cf\u306f\u4e0a\u66f8\u304d\uff06\u524a\u9664\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\uff09\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b<\/li>\n<\/ol>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>React<\/code>\u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u5165\u529b\u3092\u3064\u304f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u6ecb\u8cc0\u770c\u306e\u65e5\u91ce\u753a\u3001<br \/>\n\u3044\u3044\u3068\u3053\u308d\u3067\u3057\u305f\ud83d\ude0a\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001Vite\u3001InertiaJS\u3001React<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p><code>Laravel<\/code>\u3067<code>Vite<\/code>\u3092\u4f7f\u3063\u3066\u958b\u767a\u304c\u3067\u304d\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<br \/>\n\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066<code>Vite<\/code>\u304c\u52d5\u304f\u3068\u3053\u308d\u307e\u3067\u6e96\u5099\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\ud83d\udcdd <a href=\"https:\/\/blog.capilano-fw.com\/?p=10845\" target=\"_blank\" rel=\"noopener\">Vite + Inertia + React \u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u00a0<\/a><\/p>\n<p>\u203b \u306a\u304a\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f<code>Laravel<\/code>\u306b\u753b\u50cf\u30d7\u30ec\u30d3\u30e5\u30fc\u7528\u306e\u30da\u30fc\u30b8\u3092\u30eb\u30fc\u30c8\u306b\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>use Inertia\\Inertia;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::get('preview_image_input', fn() =&gt; Inertia::render('PreviewImageInput\/Index'));<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u306e<code>render()<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b\u306e\u304c\u3001\u3053\u308c\u304b\u3089<code>resources\/Pages<\/code>\u5185\u306b\u3064\u304f\u308b\u3053\u3068\u306b\u306a\u308b\u300c\u30d3\u30e5\u30fc\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30eb\u30fc\u30c8\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>resources\/js\/Pages\/PreviewImageInput\/Index.jsx<\/strong><\/p>\n<pre><strong>import React from \"react\";<\/strong>\r\n<strong>import PreviewImageInput from \"@\/Components\/PreviewImageInput\";<\/strong>\r\n\r\n<strong>export default function Index() {<\/strong>\r\n\r\n<strong>    const handleImageChange = e =&gt; { \/\/ \u753b\u50cf\u306b\u5909\u5316\u304c\u3042\u3063\u305f\u3089\u5b9f\u884c\u3055\u308c\u308b<\/strong>\r\n\r\n<strong>        console.log(e);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-4\"&gt;<\/strong>\r\n<strong>            &lt;h1 className=\"font-bold mb-3\"&gt;&amp;#x1F4DD; React \u3092\u4f7f\u3063\u305f\u30d7\u30ec\u30d3\u30e5\u30fc\u3064\u304d\u753b\u50cf\u5165\u529b\u306e\u30b5\u30f3\u30d7\u30eb&lt;\/h1&gt;<\/strong>\r\n<strong>            &lt;PreviewImageInput<\/strong>\r\n<strong>                onImageChange={e =&gt; handleImageChange(e)}<\/strong>\r\n<strong>            \/&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u306a\u5185\u5bb9\u3067\u3059\u304c\u3001<code>PreviewImageInput<\/code>\u306f\u6b21\u3067\u3064\u304f\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30d3\u30e5\u30fc\u5185\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/js\/Components\/PreviewImageInput.jsx<\/strong><\/p>\n<pre><strong>import React, { useState } from 'react';<\/strong>\r\n\r\n<strong>export default function PreviewImageInput(props) {<\/strong>\r\n\r\n<strong>    \/\/ Data<\/strong>\r\n<strong>    const label = props.label || '\u753b\u50cf\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044';<\/strong>\r\n<strong>    const labelClassName = props.labelClassName || 'bg-gray-200 text-gray-700 text-sm font-bold py-2 px-4 rounded';<\/strong>\r\n<strong>    const imageClassName = props.imageClassName || 'w-48';<\/strong>\r\n<strong>    const accept = props.accept || 'image\/jpeg,image\/png';<\/strong>\r\n<strong>    const [imageData, setImageData] = useState(null);<\/strong>\r\n\r\n<strong>    \/\/ Methods<\/strong>\r\n<strong>    const handleFileChange = e =&gt; { \/\/ \u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u305f<\/strong>\r\n\r\n<strong>        const files = e.target.files;<\/strong>\r\n\r\n<strong>        if (files.length &gt; 0) {<\/strong>\r\n\r\n<strong>            const file = files[0];<\/strong>\r\n<strong>            const reader = new FileReader();<\/strong>\r\n<strong>            reader.onload = e =&gt; {<\/strong>\r\n\r\n<strong>                const imageData = e.target.result;<\/strong>\r\n<strong>                setImageData(imageData);<\/strong>\r\n<strong>                handleImageChange({<\/strong>\r\n<strong>                    status: 'added',<\/strong>\r\n<strong>                    file: file,<\/strong>\r\n<strong>                    imageData: imageData<\/strong>\r\n<strong>                });<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>            reader.readAsDataURL(file);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const handleImageDelete = () =&gt; { \/\/ \u753b\u50cf\u306e\u524a\u9664<\/strong>\r\n\r\n<strong>        if(confirm('\u753b\u50cf\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) {<\/strong>\r\n\r\n<strong>            setImageData(null);<\/strong>\r\n<strong>            handleImageChange({<\/strong>\r\n<strong>                status: 'removed',<\/strong>\r\n<strong>                file: null,<\/strong>\r\n<strong>                imageData: null<\/strong>\r\n<strong>            });<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const handleImageChange = e =&gt; { \/\/ \u753b\u50cf\u306b\u5909\u5316\u304c\u3042\u3063\u305f\u3068\u304d<\/strong>\r\n\r\n<strong>        if(typeof props.onImageChange === 'function') { \/\/ \u547c\u3073\u51fa\u3057\u5074\u3067\u30a4\u30d9\u30f3\u30c8\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u308c\u3070\u5b9f\u884c<\/strong>\r\n\r\n<strong>            props.onImageChange(e);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;&gt;<\/strong>\r\n<strong>            &lt;label className={labelClassName}&gt;<\/strong>\r\n<strong>                {label}<\/strong>\r\n<strong>                &lt;input<\/strong>\r\n<strong>                    type=\"file\"<\/strong>\r\n<strong>                    accept={accept}<\/strong>\r\n<strong>                    style={{ display: 'none' }}<\/strong>\r\n<strong>                    onChange={e =&gt; handleFileChange(e)}<\/strong>\r\n<strong>                \/&gt;<\/strong>\r\n<strong>            &lt;\/label&gt;<\/strong>\r\n<strong>            {imageData &amp;&amp;<\/strong>\r\n<strong>                &lt;div className=\"mt-5\"&gt;<\/strong>\r\n<strong>                    &lt;img src={imageData} className={imageClassName} \/&gt;<\/strong>\r\n<strong>                    &lt;button<\/strong>\r\n<strong>                        type=\"button\"<\/strong>\r\n<strong>                        className=\"bg-red-500 text-gray-100 text-sm font-bold py-1 px-3 rounded mt-3\"<\/strong>\r\n<strong>                        onClick={e =&gt; handleImageDelete(e)}&gt;\u524a\u9664&lt;\/button&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        &lt;\/&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3088\u304f\u7528\u3044\u3089\u308c\u308b\u3001\u4ee5\u4e0b\u306e\u6d41\u308c\u3092<code>React<\/code>\u3067\u5b9f\u88c5\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u753b\u50cf\u3092\u9078\u629e<\/li>\n<li>JavaScript \u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080<\/li>\n<li>\u753b\u50cf\u30c7\u30fc\u30bf\u3092 &lt;img&gt; \u30bf\u30b0\u3078\u30bb\u30c3\u30c8<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u91cd\u8981\u306a\u306e\u304c\u4ee5\u4e0b\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre><strong>props.onImageChange(e);<\/strong><\/pre>\n<p>\u3053\u308c\u306f\u3001<code>props<\/code>\u3092\u901a\u3057\u3066\u89aa\u306e\u8981\u7d20\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3093\u3067\u3059\u306d\u3002\uff08\u3053\u3053\u306f\u30db\u30f3\u30c8\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u3044\u3044\u3067\u3059\u306d\ud83d\udc4d\uff09<\/p>\n<p>\u3064\u307e\u308a\u3001<code>Index.jsx<\/code>\u3067\u8a00\u3046\u3068\u3001\u4ee5\u4e0b\u306e\u592a\u5b57\u306e\u90e8\u5206\u304c\u5b9f\u884c\u3055\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>resources\/js\/Pages\/PreviewImageInput\/Index.jsx<\/strong><\/p>\n<pre>&lt;PreviewImageInput\r\n    <strong>onImageChange={e =&gt; handleImageChange(e)}<\/strong>\r\n\/&gt;<\/pre>\n<p>\u305d\u306e\u305f\u3081\u3001<code>onImageChange<\/code>\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306b\u306f\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u4ee5\u4e0b\u306eIF\u6587\u3067\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>if(typeof props.onImageChange === 'function') {<\/strong>\r\n\r\n     \/\/ \u30a4\u30d9\u30f3\u30c8\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u308c\u3070\u5b9f\u884c\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306f\u77ed\u3044\u3067\u3059\u304c\u3053\u308c\u3067\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002\ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e<code>Vite<\/code>\u3092\u5229\u7528\u3057\u305f\u958b\u767a\u3067\u306f\u3001\u3053\u308c\u307e\u3067\u5fc5\u8981\u3060\u3063\u305f\u300c<strong>\u30d3\u30eb\u30c9\uff08\u69cb\u7bc9\uff09\u5f85\u3061<\/strong>\u300d\u304c\u307b\u307c\u306a\u304f\u306a\u308b\u305f\u3081\u3001\u9ad8\u901f\u306a\u958b\u767a\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u6bce\u56de\u30d3\u30eb\u30c9\u306b10\u79d2\u5fc5\u8981\u3060\u3063\u305f\u3068\u3059\u308b\u30686\u56de\u30d3\u30eb\u30c9\u3059\u308b\u3060\u3051\u306760\u79d2\uff1d1\u5206\u7121\u99c4\u306b\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u3082\u3057100\u56de\u30d3\u30eb\u30c9\u3059\u308b\u3068\u306a\u308b\u30681000\u79d2=16\u520640\u79d2\u3067\u3059\u3002<\/p>\n<p>16\u5206\u3042\u3063\u305f\u3089\u3001\u5c0f\u3055\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306a\u3089\u5341\u5206\u3064\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u308c\u304c\u6708\u5358\u4f4d\u3068\u306a\u308b\u3068\u2026 or \u958b\u767a\u4eba\u6570\u304c\u591a\u304f\u306a\u308b\u3068\u2026<\/p>\n<p>\u305d\u3046\u3067\u3059\u3002<br \/>\n\u305d\u306e\u5206\u4e0d\u5fc5\u8981\u306a\u6642\u9593\u304c\u5fc5\u8981\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305c\u3072<code>Vite<\/code>\u3092\u4f7f\u3063\u305f\u69cb\u7bc9\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u4f5c\u308a\u307e\u3057\u305f<\/h1>\n<p>\ud83d\udcdd <a href=\"https:\/\/demo-laravel9x-vite.capilano-fw.com\/preview_image_input\" target=\"_blank\" rel=\"noopener\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a><\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u300c<strong>https:\/\/******\/preview_image_input<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>npm run dev<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u3001\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c<strong>\u3053\u306e\u524d\u884c\u3063\u305f\u3001\u6ecb\u8cc0\u770c\u306e\u30d3\u30fc\u30eb\u91b8\u9020\u6240\u306e\u5199\u771f \ud83c\udf7a<\/strong>\u300d\u3092\u9078\u629e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10890\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_1.png\" alt=\"\" width=\"440\" height=\"102\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_1.png 440w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_1-300x70.png 300w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10891\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_2.png\" alt=\"\" width=\"425\" height=\"409\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_2.png 425w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_2-300x289.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3046\u307e\u304f\u30d3\u30fc\u30eb\u306e\u5199\u771f\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u65b9\u306f\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10892\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_3.png\" alt=\"\" width=\"586\" height=\"85\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_3.png 586w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_3-300x44.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/p>\n<p>\u306f\u3044\u2757<\/p>\n<p><code>status<\/code>\u304c<code>added<\/code>\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u753b\u50cf\u30c7\u30fc\u30bf\u3084\u30d5\u30a1\u30a4\u30eb\u672c\u4f53\u3082\u53d6\u5f97\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u3053\u306e\u307e\u307e\u306e\u72b6\u614b\u3067\u5225\u306e\u5199\u771f\uff08\u3053\u306e\u524d\u898b\u306b\u884c\u3063\u305f\u73cd\u30dd\u30b9\u30c8\uff09\u3092\u9078\u629e\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u3063\u305f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10893\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_4.png\" alt=\"\" width=\"436\" height=\"410\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_4.png 436w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_4-300x282.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/p>\n<p>\u306f\u3044\u2757\u753b\u50cf\u304c\u5207\u308a\u66ff\u308f\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3053\u3061\u3089\u3082\u6210\u529f\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b\u300c<strong>\u524a\u9664<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u753b\u50cf\u304c\u6d88\u3048\u308b\u304b\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10894\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_5.png\" alt=\"\" width=\"427\" height=\"97\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_5.png 427w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_5-300x68.png 300w\" sizes=\"auto, (max-width: 427px) 100vw, 427px\" \/><\/p>\n<p>\u753b\u50cf\u304c\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u3067\u306f\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10895\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_6.png\" alt=\"\" width=\"358\" height=\"81\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_6.png 358w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/react_preview_image_input_6-300x68.png 300w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/p>\n<p>\u4eca\u56de\u306f<code>status<\/code>\u304c<code>removed<\/code>\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u753b\u50cf\uff06\u30d5\u30a1\u30a4\u30eb\u3082<code>null<\/code>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>React<\/code>\u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u3064\u304d\u306e\u5165\u529b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306a\u4eca\u56de\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u306f\u3001<code>props.XXXXXX()<\/code>\u3067\u89aa\u8981\u7d20\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><code>Vue<\/code>\u3067\u306f<code>emit<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5c11\u3057\u30af\u30bb\u304c\u5f37\u3044\u90e8\u5206\u3060\u3063\u305f\u306e\u3067\u4eca\u56de\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306f\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u597d\u611f\u89e6\u3067\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3044\u308d\u3044\u308d\u3068\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6068 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png\" alt=\"\" width=\"226\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/>\u300c\u6ecb\u8cc0\u770c\u306e\u307d\u3051\u30d5\u30bf\u3001<br \/>\n\u5168\u4ef6\u30b2\u30c3\u30c8\u3057\u307e\u3057\u305f\u2757\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\uff06\u524d\u3005\u56de\u304b\u3089Vite\u3092\u4f7f\u3063\u305fReact\u306e\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u304c\u3001\u3044\u304b\u304c\u3060\u3063\u305f\u3067\u3057\u3087\u3046\u304b\u3002 \u500b\u4eba\u7684\u306b\u306f\u9577\u3089\u304fVue\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u307e\u3060\u307e\u3060\u52b9\u7387\u5316\u3067 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=10887\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011React \u3092\u4f7f\u3063\u305f\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u50cf\u5165\u529b\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":10898,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,12],"tags":[],"class_list":["post-10887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-react-js","category-vue-js"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10887","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=10887"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10887\/revisions"}],"predecessor-version":[{"id":11011,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10887\/revisions\/11011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/10898"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}