<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bookreadkun</author_name>
  <author_url>https://blog.hatena.ne.jp/bookreadkun/</author_url>
  <blog_title>おーみんブログ</blog_title>
  <blog_url>https://oooomincrypto.hatenadiary.jp/</blog_url>
  <categories>
    <anon>React</anon>
  </categories>
  <description>はじめに 以前の記事でuseStateで配列を更新する際にmapを用いた例を記載していました。 useStateで配列を扱う備忘録 - おーみんブログ その方法でも問題なく動きはするのですが、filterを用いたほうがより分岐も少なく、可読性が上がりそうだったのでそちらの処理を備忘録として残します。 サンプルコード スプレッド構文とfilter関数を用いて以下のような処理を書きます。 // 値を定義 const [value, setValue] = useState([]) // オブジェクト型の配列と仮定しています // filter関数で更新対象の配列を排除し、新たに値を挿入します。 s…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Foooomincrypto.hatenadiary.jp%2Fentry%2F2022%2F09%2F18%2F121019&quot; title=&quot;useStateの配列をfilterを用いて更新する方法 - おーみんブログ&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>2022-09-18 12:10:19</published>
  <title>useStateの配列をfilterを用いて更新する方法</title>
  <type>rich</type>
  <url>https://oooomincrypto.hatenadiary.jp/entry/2022/09/18/121019</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
