<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>panda_noir</author_name>
  <author_url>https://blog.hatena.ne.jp/panda_noir/</author_url>
  <blog_title>Panda Noir</blog_title>
  <blog_url>https://www.pandanoir.info/</blog_url>
  <categories>
    <anon>React</anon>
    <anon>React hooks</anon>
    <anon>JavaScript</anon>
    <anon>TypeScript</anon>
  </categories>
  <description>depsに入れなくて良い、ではなく、入れてはならない です。 エフェクトイベント関数をdepsに入れるとレンダリング毎にエフェクトが走る useEffectEventは レンダリングごとに新しい関数を返します (検証用デモ)。 そのため、useEffect の deps にエフェクトイベントを含めると毎回エフェクトが実行されます(時にはこれによって 無限ループが起きます ) const effectEventFn = useEffectEvent(callback); // レンダリングのたびに新しい関数が返される useEffect(() =&gt; { return listen(effectE…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pandanoir.info%2Fentry%2F2025%2F10%2F05%2F222424&quot; title=&quot;エフェクトイベント関数はuseEffectのdepsに&amp;quot;入れてはならない&amp;quot; - Panda Noir&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-10-05 22:24:24</published>
  <title>エフェクトイベント関数はuseEffectのdepsに&quot;入れてはならない&quot;</title>
  <type>rich</type>
  <url>https://www.pandanoir.info/entry/2025/10/05/222424</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
