{"id":2813,"date":"2022-06-14T20:05:56","date_gmt":"2022-06-14T11:05:56","guid":{"rendered":"https:\/\/weseek.co.jp\/tech\/?p=2813"},"modified":"2023-04-17T10:27:22","modified_gmt":"2023-04-17T01:27:22","slug":"react%ef%bc%86swr%e3%81%a7%e3%83%ac%e3%83%b3%e3%83%80%e3%83%aa%e3%83%b3%e3%82%b0%e6%99%82%e3%81%ae%e3%83%81%e3%83%a9%e3%81%a4%e3%81%8d%e3%82%92%e6%92%b2%e6%bb%85%e3%81%99%e3%82%8b%ef%bc%93%e3%81%a4","status":"publish","type":"post","link":"https:\/\/weseek.co.jp\/tech\/2813\/","title":{"rendered":"React\uff06SWR\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u6642\u306e\u30c1\u30e9\u3064\u304d\u3092\u64b2\u6ec5\u3059\u308b\uff13\u3064\u306e\u30c6\u30af\u30cb\u30c3\u30af"},"content":{"rendered":"<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u30b9\u30c6\u30fc\u30bf\u30b9<\/th>\n<th style=\"text-align: center;\">\u6709\u7528\u5ea6<\/th>\n<th style=\"text-align: center;\">\u65e5\u6642<\/th>\n<th style=\"text-align: center;\">\u5099\u8003<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">\u516c\u958b<\/td>\n<td style=\"text-align: center;\">\u2b50\u2b50\u2b50<\/td>\n<td style=\"text-align: center;\">2022\/06\/14<\/td>\n<td style=\"text-align: center;\"><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\u66f4\u65b0<\/td>\n<td style=\"text-align: center;\">\u2b50\u2b50\u2b50<\/td>\n<td style=\"text-align: center;\">2022\/09\/30<\/td>\n<td style=\"text-align: center;\">SWR 2.0 \u306b\u95a2\u3059\u308b\u8ffd\u8a18<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>UI flickering \u306f\u30a4\u30b1\u3066\u306a\u3044<\/h1>\n<p>WESEEK \u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u6b66\u4e95\u3067\u3059\u3002<\/p>\n<p>\u307f\u306a\u3055\u3093\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3084\u3063\u3066\u307e\u3059\u304b\uff1f<br \/>\n\u4eca\u56de\u306e\u30cd\u30bf\u306f\u300cUI flickering\u300d\u3002React \u306e\u521d\u56de\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3084\u30b9\u30c6\u30fc\u30c8\u3092\u66f4\u65b0\u3057\u305f\u969b\u3001\u3053\u3093\u306a\u611f\u3058\u306e\u6319\u52d5\u3057\u3066\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img src=\"https:\/\/i.stack.imgur.com\/o7Mbz.gif\" alt=\"react-ui-flickering-when-state-updated\" \/><\/p>\n<p><small>\u51fa\u5178: <a href=\"https:\/\/stackoverflow.com\/questions\/55032136\/react-ui-flickering-when-state-updated\">https:\/\/stackoverflow.com\/questions\/55032136\/react-ui-flickering-when-state-updated<\/a><\/small><\/p>\n<p>\u3053\u306e\u4e00\u77ac\u4eca\u63cf\u753b\u3057\u3066\u3044\u308b\u30a2\u30a4\u30c6\u30e0\u6d88\u3048\u3066\u30d1\u30c3\u3068\u6b21\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u51fa\u3066\u304f\u308b\u307e\u3067\u306e\u4e00\u77ac\u306e\u9593\u304c\u898b\u3048\u308b\u73fe\u8c61\u3001\u3053\u3061\u3089\u304c\u300cUI flickering\u300d\u3067\u3059\u3002<\/p>\n<p>\u548c\u88fd\u82f1\u8a9e\u3060\u3068\u300cUI\u30d5\u30ea\u30c3\u30ab\u30fc\u300d\u3068\u304b\u8a00\u308f\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u304c\u3042\u307e\u308a\u4e00\u822c\u7684\u3067\u306f\u306a\u304f\u3001\u300c\u30ab\u30af\u3064\u304d\u300d\u300c\u30c1\u30e9\u3064\u304d\u300d\u307f\u305f\u3044\u306a\u8868\u73fe\u306e\u65b9\u304c\u99b4\u67d3\u307f\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>UI flickering \u306f\u3001\u666e\u901a\u306b React \u3067 Backend\/DB \u304b\u3089\u30c7\u30fc\u30bf\u53d6\u3063\u3066\u304d\u3066\u66f4\u65b0\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f55\u3082\u8003\u3048\u305a\u306b\u66f8\u304f\u3068\u5927\u4f53\u8d77\u3053\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002UI\/UX \u304c\u58ca\u6ec5\u7684\u306b\u60aa\u304f\u306a\u308b\u3082\u306e\u3067\u306f\u306a\u3044\u306e\u3067\u30d7\u30ed\u30c0\u30af\u30c8\u30fb\u5b9f\u88c5\u7b87\u6240\u306b\u3088\u3063\u3066\u306f\u8a31\u5bb9\u3055\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30a4\u30b1\u3066\u308b\u304b\u30a4\u30b1\u3066\u306a\u3044\u304b\u3067\u8a00\u3048\u3070\u3084\u3063\u3071\u308a\u3042\u3093\u307e\u308a\u30a4\u30b1\u3066\u306a\u3044\u90e8\u985e\u306b\u5165\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u305d\u308c\u3092\u64b2\u6ec5\u3059\u308b\u305f\u3081\u306e3\u3064\u306e Tips \u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h1>\u76ee\u6b21<\/h1>\n\n<h1>\u5bfe\u7b561. \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306f\u30b9\u30b1\u30eb\u30c8\u30f3\u3092\u8868\u793a\u3059\u308b<\/h1>\n<p>\u4e00\u756a\u5358\u7d14\u306a\u6226\u7565\u306f\u3001\u30b9\u30b1\u30eb\u30c8\u30f3\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u7528\u610f\u3057\u3001\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306f\u305d\u3061\u3089\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-typescript\">const MyComponent = (): JSX.Element =&gt; {\n\n  const [isLoading, setLoading] = useState(false);\n\n  ...\n\n  return isLoading\n    ? &lt;MyListSkelton length={data.length} \/&gt;\n    : &lt;MyList \/&gt;;\n}<\/code><\/pre>\n<p>MyList \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u540c\u3058\u3088\u3046\u306a MyListSkelton \u3092\u7528\u610f\u3057\u3066\u304a\u304d\u3001\u4ee3\u308f\u308a\u306b\u305d\u308c\u3092\u8868\u793a\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3053\u306e\u3088\u3046\u306a\u30b7\u30fc\u30f3\u3067\u306f\u30b9\u30d4\u30ca\u30fc\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u8868\u793a\u3057\u305f\u3044\u30a2\u30a4\u30c6\u30e0\u7fa4\u3068\u540c\u3058\u5e45\u30fb\u9ad8\u3055\u3092\u6301\u3064\u30b9\u30b1\u30eb\u30c8\u30f3\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3067 UI flickering \u3092\u6291\u5236\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img src=\"https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/mui-skelton-example-300x219.png\" alt=\"MUI Skelton Example\" \/><br \/>\n<small>\u51fa\u5178: <a href=\"https:\/\/mui.com\/material-ui\/react-skeleton\">https:\/\/mui.com\/material-ui\/react-skeleton<\/a><\/small><\/p>\n<p>\u30b9\u30b1\u30eb\u30c8\u30f3\u306b\u3064\u3044\u3066\u306f <a href=\"https:\/\/mui.com\/material-ui\/react-skeleton\">Material UI<\/a> \u306a\u3069\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<a href=\"https:\/\/www.npmjs.com\/package\/react-loading-skeleton\">react-loading-skelton<\/a> \u3082\u6c4e\u7528\u7684\u3067\u4fbf\u5229\u3002React \u4ee5\u5916\u3067\u3082\u4f7f\u3048\u308b\u306e\u3060\u3068 <a href=\"https:\/\/placeholder.com\/\">Placehold-it<\/a> \u3082\u6709\u540d\u3067\u3059\u306d\u3002\u7d20\u306e Bootstrap 5 \u306b\u3082\u3053\u3046\u3044\u3046\u306e\u3042\u3063\u305f\u3089\u3044\u3044\u3093\u3060\u3051\u3069\u306a\u3042\u3002<\/p>\n<h1>SWR \u3092\u4f7f\u304a\u3046<\/h1>\n<p>\u5bfe\u7b56\u306e2\u3064\u3081\u306e\u8aac\u660e\u306b\u5165\u308b\u524d\u306b\u3001<a href=\"https:\/\/swr.vercel.app\/\">SWR<\/a> \u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/swr.vercel.app\/\"><img loading=\"lazy\" src=\"https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-1024x288.png\" style=\"border: solid 1px #ccc\" alt=\"\" width=\"512\" height=\"144\" class=\"aligncenter size-large wp-image-2844\" srcset=\"https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-1024x288.png 1024w, https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-300x84.png 300w, https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-768x216.png 768w, https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-304x85.png 304w, https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1-282x79.png 282w, https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/swr-1.png 1092w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>SWR \u3068\u306f &quot;stale-while-revalidate&quot; \u306e\u982d\u6587\u5b57\u3092\u53d6\u3063\u305f\u3082\u306e\u3067\u3001HTTP \u901a\u4fe1\u306b\u65bc\u3051\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u6226\u7565\u306e\u6982\u5ff5\u30fb\u4ed5\u69d8\u3067\u3059\u3002\u305d\u3057\u3066 Vercel \u304c\u4f5c\u3063\u3066\u3044\u308b\u540c\u540d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea(\u5b9f\u88c5)\u304c\u5b58\u5728\u3057\u3001React \u3068\u4e00\u7dd2\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f3c\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u306f <a href=\"https:\/\/react-query.tanstack.com\/\">React Query<\/a> \u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>SWR \u306e\u3046\u308c\u3057\u307f<\/h2>\n<p>\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u4e3b\u8981\u306a\u3082\u306e\u3092\u6319\u3052\u308b\u3068\u3001<\/p>\n<ul>\n<li>\u30c7\u30fc\u30bf\u53d6\u5f97\u306e\u5f8c\u3001\u7d50\u679c\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u5316\u304c\u7c21\u5358\u306b\u306a\u308b<\/li>\n<li>\u30c7\u30fc\u30bf\u66f4\u65b0\u3001\u518d\u53d6\u5f97\u304c\u5fc5\u8981\u306b\u306a\u3063\u305f\u3068\u304d\u306e\u624b\u9806\u304c\u7c21\u5358\u306b\u306a\u308b<\/li>\n<\/ul>\n<p>\u305d\u3057\u3066\u3001<\/p>\n<ul>\n<li>\u300c\u5bfe\u7b561. \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306f\u30b9\u30b1\u30eb\u30c8\u30f3\u3092\u8868\u793a\u3059\u308b\u300d\u306e <code>isLoading<\/code> \u306e\u7ba1\u7406\u304c\u7c21\u5358\u306b\u306a\u308b<\/li>\n<\/ul>\n<p>\u3053\u3061\u3089\u304c\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3067 SWR \u3092\u63a8\u3059\u7406\u7531\u3067\u3059\u3002<\/p>\n<h2>SWR \u5229\u7528 Example<\/h2>\n<pre><code class=\"language-typescript\">import { useSWRxMyListData } from &#039;..\/stores\/mylist&#039;;\n\nconst MyComponent = (): JSX.Element =&gt; {\n\n  const { data, error } = useSWRxMyListData();\n\n  ...\n\n  const isLoading = error == null &amp;&amp; data === undefined;\n\n  return isLoading\n    ? &lt;MyListSkelton length={data.length} \/&gt;\n    : &lt;MyList \/&gt;;\n}<\/code><\/pre>\n<pre><code class=\"language-typescript\">const fetcher = url =&gt; fetch(url).then(r =&gt; r.json())\n\nexport const useSWRxPage = (): SWRResponse&lt;MyListData, Error&gt; =&gt; {\n  return useSWR&lt;MyListData&gt;(&#039;\/_api\/mylist&#039;, fetcher);\n};<\/code><\/pre>\n<p>SWR \u7d50\u679c\u304b\u3089 <code>isLoading<\/code> \u304c\u4f5c\u3089\u308c\u308b\u305f\u3081\u3001\u901a\u4fe1\u958b\u59cb\u6642\u306b true \u306b\u3057\u3066\u3001finally \u3067 false \u306b\u623b\u3057\u3066\u307f\u305f\u3044\u306a\u7ba1\u7406\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u86c7\u8db3 1<\/h3>\n<p>\u56e0\u307f\u306b WESEEK \u3067\u306f JavaScript\/TypeScript \u306e\u30b3\u30fc\u30c9\u4e2d\u3067 null\/undefined \u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u5834\u5408\u306f<\/p>\n<pre><code class=\"language-typescript\">if (value != null) {...}<\/code><\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001\u53b3\u5bc6\u7b49\u4fa1\u6f14\u7b97\u5b50\u3067\u306f\u306a\u304f\u7b49\u4fa1\u6f14\u7b97\u5b50\u3068 null \u5024\u3068\u306e\u6bd4\u8f03\u306b\u7d71\u4e00\u3057\u3066\u3044\u307e\u3059\u304c\u3001SWR \u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u524d\u306e\u72b6\u614b\u3092\u5224\u5b9a\u3059\u308b\u5834\u5408\u306f <code>=== undefined<\/code> \u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u7406\u7531\u306f\u53d6\u5f97\u30c7\u30fc\u30bf\u304c null \u5024\u306e\u5834\u5408\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u306d\u3002\u30d7\u30ed\u30c0\u30af\u30c8\u306e\u4e2d\u3067\u306f\u73cd\u3057\u3044\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/tips.weseek.co.jp\/5fb74e7aa1ba4200489a4bd1#\u5224\u5b9a\u5f0f\">\/Tips\/JavaScript#\u5224\u5b9a\u5f0f<\/a><\/p>\n<h1>\u5bfe\u7b562. \u521d\u671f\u30b9\u30c6\u30fc\u30c8\u3092 localStorage \u304b\u3089\u53d6\u5f97\u3059\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u306e\u5bfe\u7b56\u306f\u3001\u3042\u308b\u6761\u4ef6\u4e0b\u30fb\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u306e\u3082\u3068\u3067\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070 VSCode \u306e\u3088\u3046\u306a\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u3057\u3066\u3001\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u958b\u9589\u72b6\u614b\u3092\u30b5\u30fc\u30d0\u30fc\u5074(DB\u5074)\u3067\u4fdd\u6301\u3059\u308b\u3088\u3046\u306a\u30b7\u30ca\u30ea\u30aa\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img src=\"https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/ss-sidebar-close-300x225.png\" alt=\"VSCode Sidebar Closed\" \/> <img src=\"https:\/\/weseek.co.jp\/tech\/wp-content\/uploads\/2022\/06\/ss-sidebar-open-300x225.png\" alt=\"VSCode Sidebar Opened\" \/><\/p>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u30a2\u30d7\u30ea\u3092\u4f7f\u3046\u6642\u306b\u3001\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u958b\u9589\u72b6\u614b\u3092\u5909\u3048\u305f\n<ul>\n<li>\u958b\u9589\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u305d\u306e\u5024\u304c DB \u306b\u4fdd\u5b58\u3055\u308c\u308b<\/li>\n<\/ul>\n<\/li>\n<li>\u6b21\u56de\u30a2\u30af\u30bb\u30b9\u6642\u306f\u30b5\u30a4\u30c9\u30d0\u30fc\u958b\u9589\u72b6\u614b\u304c\u5fa9\u5143\u3055\u308c\u308b<\/li>\n<\/ol>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre><code class=\"language-typescript\">import { useSWRxMySettings } from &#039;..\/stores\/mysettings&#039;;\n\nconst App = (): JSX.Element =&gt; {\n\n  const { data: mySettings } = useSWRxMySettings(userId);\n\n  ...\n\n  return (\n    &lt;&gt;\n      &lt;Sidebar isOpen={mySettings.isSidebarOpened} \/&gt;\n      &lt;Contents \/&gt;\n    &lt;\/&gt;;\n  )\n}<\/code><\/pre>\n<pre><code class=\"language-typescript\">const fetcher = url =&gt; fetch(url, params).then(r =&gt; r.json())\n\nexport const useSWRxMySettings = (userId: string): SWRResponse&lt;UISettings, Error&gt; =&gt; {\n  return useSWR&lt;UISettings&gt;(\n    [&#039;\/_api\/mysettings&#039;, { userId }],\n    fetcher\n  );\n};<\/code><\/pre>\n<p>\u3055\u3066\u3001\u3053\u3053\u3067\u521d\u56de\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u3069\u3046\u3059\u308b\u304b\u304c\u60a9\u307e\u3057\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u72b6\u614b\u3092\u6b63\u78ba\u306b\u518d\u73fe\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u5024\u306f\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u304c\u6301\u3063\u3066\u3044\u308b\u306e\u3067\u307e\u305a API \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306f\u5fc5\u9808\u3067\u3059\u304c\u3001\u305d\u306e\u901a\u4fe1\u7d50\u679c\u3092\u5f85\u305f\u306a\u3044\u3068\u30e6\u30fc\u30b6\u30fc\u304c\u671f\u5f85\u3059\u308b UI\u3001\u3064\u307e\u308a\u30b5\u30a4\u30c9\u30d0\u30fc\u3092\u958b\u3044\u3066\u63cf\u753b\u3059\u308b\u304b\u9589\u3058\u3066\u63cf\u753b\u3059\u308b\u304b\u3092\u6c7a\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u4f55\u3082\u8003\u3048\u305a\u306b\u300c\u30c7\u30d5\u30a9\u30eb\u30c8\u30b9\u30c6\u30fc\u30c8\u3092\u9589\u3058\u305f\u72b6\u614b\u300d\u3068\u3059\u308b\u3068\u3001\u4fdd\u5b58\u3055\u308c\u305f\u8a2d\u5b9a\u5024\u304c\u300c\u958b\u3044\u305f\u72b6\u614b\u300d\u3060\u3063\u305f\u969b\u306b UI flickering \u304c\u8d77\u304d\u308b\u3067\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u300c\u5bfe\u7b561. \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306f\u30b9\u30b1\u30eb\u30c8\u30f3\u3092\u8868\u793a\u3059\u308b\u300d\u306f\u305d\u3082\u305d\u3082\u5e45\u30fb\u9ad8\u3055\u3092\u3068\u3063\u3066\u3044\u3044\u30b1\u30fc\u30b9\u306a\u306e\u304b\u3069\u3046\u304b\u304c\u78ba\u5b9a\u3057\u3066\u3044\u306a\u3044\u4eca\u56de\u306f\u4f7f\u3048\u307e\u305b\u3093\u306d\u3002<\/p>\n<p>\u4e00\u3064\u306e\u9078\u629e\u80a2\u3068\u3057\u3066\u3001\u300c\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u304b\u3089\u306e\u8a2d\u5b9a\u5024\u304c\u5c4a\u304f\u307e\u3067\u3001\u753b\u9762\u5168\u4f53\u3092\u30ed\u30fc\u30c9\u4e2d\u72b6\u614b\u3068\u3057\u3066\u3088\u3044\u300d\u3068\u3044\u3046\u4ed5\u69d8\u3067\u3088\u3044\u3068\u5272\u308a\u5207\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u521d\u56de\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u304c\u9045\u304f\u306a\u308b\u3053\u3068\u3068\u5f15\u304d\u63db\u3048\u306b UI flickering \u3092\u907f\u3051\u3089\u308c\u307e\u3059\u3002\u305d\u306e\u9045\u5ef6\u3092 UX \u7684\u306b\u8a31\u5bb9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u5225\u306e\u5bfe\u7b56\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2>localStorage \u3078\u306e\u4fdd\u5b58\u306e\u691c\u8a0e<\/h2>\n<p>\u3053\u306e\u30b1\u30fc\u30b9\u3078\u306e\u5bfe\u7b56\u3068\u3057\u3066\u3001DB \u306b\u4fdd\u5b58\u3057\u305f\u8a2d\u5b9a\u5024\u3092 localStorage \u306b\u3082\u4fdd\u5b58\u30fb\u540c\u671f\u3059\u308b\u6226\u7565\u3092\u691c\u8a0e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u30a2\u30d7\u30ea\u3092\u4f7f\u3046\u6642\u306b\u3001UI\u8a2d\u5b9a\u3092\u5909\u3048\u305f\n<ul>\n<li>\u4e0a\u8a18\u7d50\u679c\u304c DB \u306b\u4fdd\u5b58\u3055\u308c\u308b<\/li>\n<li><strong>\u540c\u6642\u306b\u30e6\u30fc\u30b6\u30fc\u306e\u30d6\u30e9\u30a6\u30b6\u306e localStorage \u306b\u540c\u3058\u8a2d\u5b9a\u5024\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b<\/strong><\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6b21\u56de\u30a2\u30af\u30bb\u30b9\u6642\u3001localStorage \u306b\u5165\u3063\u3066\u3044\u308b\u8a2d\u5b9a\u5024\u3092\u53d6\u308a\u51fa\u3057\u3001SWR \u306e\u521d\u671f\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u5165\u308c\u308b<\/strong>\n<ul>\n<li>\u5927\u4f53\u306e\u30b1\u30fc\u30b9\u3067 REST \u306e\u901a\u4fe1\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3088\u308a\u3082 localStorage \u304b\u3089\u306e\u5024\u62bd\u51fa\u306e\u65b9\u304c\u65e9\u3044\u306e\u3067\u3001\u3053\u3061\u3089\u3092\u5229\u7528\u3057\u3066\u521d\u56de\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u304c\u884c\u308f\u308c\u308b<\/li>\n<\/ul>\n<\/li>\n<li>DB \u304b\u3089\u53d6\u5f97\u3057\u305f\u7d50\u679c\u3092\u9069\u7528\u3057\u3001\u518d\u5ea6\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u308b\n<ul>\n<li>localStorage \u306b\u5165\u3063\u3066\u3044\u308b\u8a2d\u5b9a\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u308c\u3070\u3001UI flickering \u304c\u8d77\u3053\u3089\u306a\u3044<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u3067\u306f\u3053\u308c\u3092\u3069\u3046\u5b9f\u73fe\u3059\u308c\u3070\u3044\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<h2>\u6c4e\u7528 SWR middleware (\u4fdd\u5b58\u7248)<\/h2>\n<p>\u306f\u3044\u3001\u3053\u3061\u3089\u3092\u30b3\u30d4\u30da\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3057\u3066\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002<br \/>\n\u89e3\u8aac\u306f\u7701\u304d\u307e\u3059\u304c\u3001SWR hook \u306b\u6307\u5b9a\u53ef\u80fd\u306a <code>fallbackData<\/code> \u306b localStorage \u7531\u6765\u306e\u8a2d\u5b9a\u5024\u3092\u5165\u308c\u3066\u521d\u671f\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-typescript\">import { Middleware } from &#039;swr&#039;;\n\nconst generateKeyInStorage = (key: string): string =&gt; {\n  return `swr-cache-${key}`;\n};\n\n\/\/ eslint-disable-next-line @typescript-eslint\/no-explicit-any\nexport type IStorageSerializer&lt;Data = any&gt; = {\n  serialize: (value: Data) =&gt; string,\n  deserialize: (value: string | null) =&gt; Data,\n}\n\nexport const createSyncToStorageMiddlware = (\n    storage: Storage,\n    storageSerializer: IStorageSerializer = {\n      serialize: JSON.stringify,\n      deserialize: JSON.parse,\n    },\n): Middleware =&gt; {\n  return (useSWRNext) =&gt; {\n    return (key, fetcher, config) =&gt; {\n      if (key == null) {\n        return useSWRNext(key, fetcher, config);\n      }\n\n      const keyInStorage = generateKeyInStorage(key.toString());\n      let initData = config.fallbackData;\n\n      \/\/ retrieve initial data from storage\n      const itemInStorage = storage.getItem(keyInStorage);\n      if (itemInStorage != null) {\n        initData = storageSerializer.deserialize(itemInStorage);\n      }\n\n      const swrNext = useSWRNext(key, fetcher, {\n        fallbackData: initData,\n        ...config,\n      });\n\n      return {\n        ...swrNext,\n        \/\/ override mutate\n        mutate: (data, shouldRevalidate) =&gt; {\n          return swrNext.mutate(data, shouldRevalidate)\n            .then((value) =&gt; {\n              storage.setItem(keyInStorage, storageSerializer.serialize(value));\n              return value;\n            });\n        },\n      };\n    };\n  };\n};\n\nexport const localStorageMiddleware = createSyncToStorageMiddlware(localStorage);\n\nexport const sessionStorageMiddleware = createSyncToStorageMiddlware(sessionStorage);<\/code><\/pre>\n<p>\u4f7f\u3044\u65b9\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30c3\u30af\u5074\u3092\u5c11\u3057\u5909\u3048\u308b\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002<code>use: [middlewareInstance]<\/code> \u3068\u3044\u3046\u5f62\u5f0f\u3067\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8db3\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-typescript\">const fetcher = url =&gt; fetch(url, params).then(r =&gt; r.json())\n\nexport const useSWRxMySettings = (userId: string): SWRResponse&lt;UISettings, Error&gt; =&gt; {\n  return useSWR&lt;UISettings&gt;(\n    [&#039;\/_api\/mysettings&#039;, { userId }],\n    fetcher,\n    { use: [localStorageMiddleware] }, \/\/ store to localStorage for initialization fastly\n  );\n};<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u300c\u5bfe\u7b561. \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306f\u30b9\u30b1\u30eb\u30c8\u30f3\u3092\u8868\u793a\u3059\u308b\u300d\u3092\u9069\u7528\u3067\u304d\u306a\u3044\u304c\u53ef\u80fd\u306a\u9650\u308a\u521d\u671f\u5024\u30bb\u30c3\u30c8\u3092\u6025\u304e\u305f\u3044\u5834\u5408\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h3>\u86c7\u8db3 2<\/h3>\n<p><a href=\"https:\/\/github.com\/weseek\/growi\">GROWI<\/a> \u3067\u306f\u5b9f\u969b\u306b\u4ee5\u4e0b\u306e\u5834\u6240\u3067\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/weseek\/growi\/blob\/v5.0.8\/packages\/app\/src\/stores\/middlewares\/sync-to-storage.ts\">stores\/middlewares\/sync-to-storage.ts<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/weseek\/growi\/blob\/v5.0.8\/packages\/app\/src\/stores\/ui.tsx#L223\">\u5229\u7528\u5074: UI \u30e2\u30fc\u30c9\u53d6\u5f97\u90e8\u5206<\/a><\/li>\n<\/ul>\n<h3>\u86c7\u8db3 3<\/h3>\n<p>\u3082\u3061\u308d\u3093\u3053\u306e\u5bfe\u7b56\u306f\u9280\u306e\u5f3e\u4e38\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>localStorage \u306b DB \u5024\u306e\u30b3\u30d4\u30fc\u3092\u4fdd\u5b58\u3059\u308b\u3068\u8a00\u3046\u3053\u3068\u306f\u3001PC\u30922\u53f0(\u307e\u305f\u306f\u30d6\u30e9\u30a6\u30b62\u7a2e\u985e)\u3092\u4f7f\u3044\u5206\u3051\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3067\u4e0d\u6574\u5408\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u983b\u7e41\u306b\u5229\u7528\u74b0\u5883\u3092\u5909\u3048\u308b\u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u306f\u3001\u304b\u3048\u3063\u3066 UI flickering \u304c\u8d77\u3053\u308a\u3084\u3059\u304f\u306a\u308b\u3053\u3068\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3092\u8003\u616e\u3057\u63a1\u5426\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u5bfe\u7b563. Revalidate \u4e2d\u306b\u524d\u306e\u30b9\u30c6\u30fc\u30c8\u3092\u521d\u671f\u5316\u3057\u306a\u3044 (&gt;= SWR@2.0.0)<\/h1>\n<p>\u3053\u306e\u5bfe\u7b56\u306f\u3001SWR \u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306e\u5148\u53d6\u308a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>2022.06.13 \u6642\u70b9\u3067 SWR \u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 1.3.0 \u3067\u3059\u304c\u3001\u958b\u767a\u30c1\u30fc\u30e0\u306f\u6b21\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3042\u308b 2.0.0 \u3092\u958b\u767a\u4e2d\u3067\u3059\u3002GitHub \u3067\u03b2\u7248\u30ea\u30ea\u30fc\u30b9\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059 <a href=\"https:\/\/github.com\/vercel\/swr\/releases\/tag\/2.0.0-beta.1\">2.0.0-beta.1<\/a> \u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b2022.09.30 \u8ffd\u8a18: SWR \u6700\u65b0\u306f\u4f9d\u7136 1.3.0 \u3067\u3001\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u30ea\u30ea\u30fc\u30b9\u306f5\u30f6\u6708\u4ee5\u4e0a\u51cd\u7d50\u3055\u308c\u3066\u3044\u307e\u3059<br \/>\n\u30002.0 \u7cfb\u6700\u65b0\u306f <a href=\"https:\/\/github.com\/vercel\/swr\/releases\/tag\/2.0.0-beta.7\">2.0.0-beta.7<\/a> \u3068\u306a\u3063\u3066\u304a\u308a\u30012.0 \u3092\u5b89\u5b9a\u3057\u305f\u3082\u306e\u3068\u3059\u308b\u4fee\u6b63\u304c\u9032\u3093\u3067\u3044\u308b\u3088\u3046\u3067\u3059<\/p>\n<h2>\u516c\u5f0f\u306e <code>isLoading<\/code> \u30b9\u30c6\u30fc\u30c8<\/h2>\n<p>\u300cSWR \u3092\u4f7f\u304a\u3046\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u3067 <code>isLoading<\/code> \u30b9\u30c6\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30fc\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-typescript\">const isLoading = error == null &amp;&amp; data === undefined;<\/code><\/pre>\n<p>2.0.0 \u3067\u306f <code>error<\/code>, <code>data<\/code> \u304b\u3089\u4f5c\u3089\u306a\u304f\u3066\u3082\u3001useSWR \u3092\u547c\u3073\u51fa\u3057\u305f\u7d50\u679c\u304b\u3089\u3053\u306e boolean \u3092\u5f97\u3089\u308c\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-typescript\">const { data, isLoading, isValidating } = useSWR(STOCK_API, fetcher, {\n  refreshInterval: 3000\n});\n\n\/\/ If it&#039;s still loading the initial data, there is nothing to display.\n\/\/ We return a skeleton here.\nif (isLoading) return &lt;div className=&quot;skeleton&quot; \/&gt;;<\/code><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3060\u3068\u5358\u306b\u4f7f\u3044\u52dd\u624b\u304c\u826f\u304f\u306a\u3063\u305f\u7a0b\u5ea6\u3067\u3059\u304c\u3001\u66f4\u306b UI flickering \u306b\u52b9\u679c\u304c\u3042\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><code>keepPreviousData<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p><video src=\"https:\/\/user-images.githubusercontent.com\/3676859\/163695903-a3eb1259-180e-41e0-821e-21c320201194.mp4\" data-canonical-src=\"https:\/\/user-images.githubusercontent.com\/3676859\/163695903-a3eb1259-180e-41e0-821e-21c320201194.mp4\" controls=\"controls\" muted=\"muted\" class=\"d-block rounded-bottom-2 border-top width-fit\" style=\"max-height:640px;\"><\/video><\/p>\n<p><small>\u51fa\u5178: <a href=\"https:\/\/github.com\/vercel\/swr\/releases\/tag\/2.0.0-beta.1\">https:\/\/github.com\/vercel\/swr\/releases\/tag\/2.0.0-beta.1<\/a><\/small><\/p>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u306e\u518d\u53d6\u5f97\u6642\u3001<code>isLoading<\/code> \u304c true \u306e\u9593\u3082\u4ee5\u524d\u306e <code>data<\/code> \u3092\u8fd4\u3057\u7d9a\u3051\u3066\u304f\u308c\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30fc\u30bf\u53d6\u5f97\u6761\u4ef6\u304c\u5909\u308f\u3063\u3066\u30c7\u30fc\u30bf\u306e\u518d\u53d6\u5f97\u3092\u884c\u3063\u3066\u3044\u308b\u9593\u306b\u8d77\u3053\u308b UI flickering \u3092\u30aa\u30d7\u30b7\u30e7\u30f3\u4e00\u3064\u3067\u6291\u5236\u3067\u304d\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<ul>\n<li>\u5e45\u30fb\u9ad8\u3055\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001\u30c7\u30fc\u30bf\u30ed\u30fc\u30c9\u4e2d\u306b\u30b9\u30b1\u30eb\u30c8\u30f3\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3067 UI flickering \u3092\u6291\u5236\u3067\u304d\u308b<\/li>\n<li>SWR \u3068\u3044\u3046 stale-while-revalidate \u6226\u7565\u304c\u3042\u308b\n<ul>\n<li>React \u5411\u3051\u306b\u306f\u540c\u540d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u3063\u3066\u4fbf\u5229<\/li>\n<\/ul>\n<\/li>\n<li>SWR \u306f\u3001HTTP \u30ea\u30af\u30a8\u30b9\u30c8\/\u30ec\u30b9\u30dd\u30f3\u30b9\u524d\u5f8c\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u80a9\u4ee3\u308f\u308a\u3057\u3001\u8ce2\u304f\u7ba1\u7406\u3057\u3066\u304f\u308c\u308b\n<ul>\n<li>\u30d7\u30ed\u30c0\u30af\u30c8\u3067\u72ec\u81ea\u5b9f\u88c5\u304c\u5fc5\u8981\u3060\u3063\u305f\u30ad\u30e3\u30c3\u30b7\u30e5\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u305f\u3081\u306e\u30b3\u30fc\u30c9\u306e\u591a\u304f\u304c\u4e0d\u8981\u306b\u306a\u308b<\/li>\n<\/ul>\n<\/li>\n<li>SWR 2.0.0 \u306b\u306f\u3082\u3063\u3068\u4fbf\u5229\u3067 UI flickring \u306b\u52b9\u679c\u304c\u3042\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u8ffd\u52a0\u3055\u308c\u308b\uff01\u697d\u3057\u307f\uff01<\/li>\n<li>DB \u306b\u3057\u304b\u306a\u3044\u5024\u3092 localStorage \u306b\u3082\u540c\u671f\u3055\u305b\u308b\u3053\u3068\u3067\u3001UI flickering \u3092\u6291\u5236\u3067\u304d\u308b\u30b1\u30fc\u30b9\u3082\u3042\u308b<\/li>\n<li><strong>UI flickering \/ UI\u30d5\u30ea\u30c3\u30ab\u30fc \/ \u753b\u9762\u306e\u30ab\u30af\u3064\u304d\u30c1\u30e9\u3064\u304d\u3092\u64b2\u6ec5\u305b\u3088<\/strong><\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u3067\u3059\u3002\u8aad\u3093\u3067\u3044\u305f\u3060\u3044\u3066\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3088\u304b\u3063\u305f\u3089 Twitter \u306e\u65b9\u3082\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6280\u8853\u30cd\u30bf\u3084\u7d44\u7e54\u4f5c\u308a\u306b\u3064\u3044\u3066\u305f\u307e\u306b\u545f\u304d\u307e\u3059 \u2192 <a href=\"https:\/\/twitter.com\/yuki_takei\">https:\/\/twitter.com\/yuki_takei<\/a><br \/>\n\u4e00\u7dd2\u306b SWR \u5e83\u3081\u307e\u3057\u3087\u3046\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b9\u30c6\u30fc\u30bf\u30b9 \u6709\u7528\u5ea6 \u65e5\u6642 \u5099\u8003 \u516c\u958b \u2b50\u2b50\u2b50 2022\/06\/14 \u66f4\u65b0 \u2b50\u2b50\u2b50 2022\/09\/30 SWR 2.0 \u306b\u95a2\u3059\u308b\u8ffd\u8a18 UI flickering \u306f\u30a4\u30b1\u3066\u306a\u3044 WESEEK \u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u6b66\u4e95\u3067\u3059\u3002 \u307f\u306a\u3055<\/p>\n","protected":false},"author":3,"featured_media":2841,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,31,52,51,57],"tags":[],"_links":{"self":[{"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/posts\/2813"}],"collection":[{"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/comments?post=2813"}],"version-history":[{"count":21,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/posts\/2813\/revisions"}],"predecessor-version":[{"id":3696,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/posts\/2813\/revisions\/3696"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/media\/2841"}],"wp:attachment":[{"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/media?parent=2813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/categories?post=2813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weseek.co.jp\/tech\/wp-json\/wp\/v2\/tags?post=2813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}