{"type":"rich","blog_title":"Panda Noir","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pandanoir.info%2Fentry%2F2023%2F02%2F14%2F191212\" title=\"\u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u3046\u3068 prevValue \u3092\u4f7f\u3046\u30d5\u30c3\u30af\u304c\u66f8\u304d\u3084\u3059\u3044 - Panda Noir\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/panda_noir/","blog_url":"https://www.pandanoir.info/","width":"100%","image_url":null,"categories":["React","React hooks"],"height":"190","version":"1.0","url":"https://www.pandanoir.info/entry/2023/02/14/191212","author_name":"panda_noir","description":"\u5c0f\u6280\u3002 \u300c\u4e00\u6642\u7684\u306a\u5909\u6570\u3092 useRef \u3067\u5b9a\u7fa9\u3057\u305f\u3044\u300d\u3068\u3044\u3063\u305f\u6642\u306b\u4fbf\u5229\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002 { const prevValue = useRef(value); useEffect(() => { if (prevValue.current === value) return; // \u5909\u5316\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u884c\u3046\u51e6\u7406 prevValue.current = value; }, [value]); } \u3084\u308a\u65b9\u306f\u7c21\u5358\u3067\u3059\u3002\u2191\u3053\u3046\u3084\u3063\u3066\u30d6\u30ed\u30c3\u30af({})\u3067\u56f2\u3080\u3060\u3051\u3067\u3059\u3002\u30b3\u30ec\u3067 prevValue \u306e\u30b9\u30b3\u30fc\u30d7\u3092\u72ed\u3081\u3089\u308c\u307e\u3059\u3002\u30d5\u30c3\u30af\u306e\u30eb\u30fc\u30eb\u306b\u3082\u62b5\u89e6\u3057\u307e\u305b\u3093\u3002 \u5024\u306e\u5909\u5316\u3092\u691c\u77e5\u3057\u3066\u526f\u4f5c\u7528\u3092\u5b9f\u884c\u3057\u305f\u3044\u3068\u304d\u306b\u50d5\u306f\u3088\u304f\u3053\u2026","published":"2023-02-14 19:12:12","provider_name":"Hatena Blog","title":"\u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u3046\u3068 prevValue \u3092\u4f7f\u3046\u30d5\u30c3\u30af\u304c\u66f8\u304d\u3084\u3059\u3044"}