<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yigarashi</author_name>
  <author_url>https://blog.hatena.ne.jp/yigarashi/</author_url>
  <blog_title>yigarashiのブログ</blog_title>
  <blog_url>https://yigarashi.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>こんにちは。最近は仕事で React を書き始めました。数年前に React を触った時は class component をせっせと書いた覚えがあるのですが、最近は functional component と react hooks を組み合わせて書くこともできるようです。react hooks の概要は公式ドキュメント等を読んでもらうことにして、本記事では、自作のカスタムフックで stateful なコンポーネントを整理する一例を紹介し、それによって享受できるメリットを少し深掘りしたいと思います。 整理する前のコード まずは僕が最初にお試しで書いた TypeScript のコードをお見せ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyigarashi.hatenablog.com%2Fentry%2Freact-custom-hook&quot; title=&quot;【React】カスタムフックでstatefulなコンポーネントを整理する - yigarashiのブログ&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>2020-02-25 09:00:00</published>
  <title>【React】カスタムフックでstatefulなコンポーネントを整理する</title>
  <type>rich</type>
  <url>https://yigarashi.hatenablog.com/entry/react-custom-hook</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
