<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>popy1017</author_name>
  <author_url>https://blog.hatena.ne.jp/popy1017/</author_url>
  <blog_title>ぽぴなび</blog_title>
  <blog_url>https://popy1017.hatenablog.com/</blog_url>
  <categories>
    <anon>備忘録</anon>
  </categories>
  <description>Reactでカスタムフックなどを使っていると、状態を表す変数名（errorやloadingなど）が同じ名前で定義されていたりします。 同じ名前の変数を分割代入で取ってくる際は、元の変数名: 変更後の変数名で取ってくることができます。 const useGetUsers = () =&gt; { const loading = false; const error = 'Failed getting users.'; const result = []; const getUsers = () =&gt; {}; return { getUsers, loading, error, result }; } …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpopy1017.hatenablog.com%2Fentry%2F2023%2F02%2F09%2F000555&quot; title=&quot;【Javascript】分割代入時に変数名を変える - ぽぴなび&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>2023-02-09 00:05:55</published>
  <title>【Javascript】分割代入時に変数名を変える</title>
  <type>rich</type>
  <url>https://popy1017.hatenablog.com/entry/2023/02/09/000555</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
