<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>State Logic on AI VOID</title><link>https://ai-blog.noorshomelab.dev/tags/state-logic/</link><description>Recent content in State Logic on AI VOID</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 31 Jan 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ai-blog.noorshomelab.dev/tags/state-logic/index.xml" rel="self" type="application/rss+xml"/><item><title>Chapter 12: Custom Hooks: Reusing Logic Across Components</title><link>https://ai-blog.noorshomelab.dev/react-mastery-2026/chapter-12-custom-hooks-reusing-logic/</link><pubDate>Sat, 31 Jan 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/react-mastery-2026/chapter-12-custom-hooks-reusing-logic/</guid><description>&lt;h2 id="chapter-12-custom-hooks-reusing-logic-across-components"&gt;Chapter 12: Custom Hooks: Reusing Logic Across Components&lt;/h2&gt;
&lt;p&gt;Welcome back, intrepid React developer! In previous chapters, we&amp;rsquo;ve explored the fundamental built-in Hooks like &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt;, which revolutionized how we manage state and side effects in functional components. You&amp;rsquo;ve seen how powerful they are for managing component-specific logic.&lt;/p&gt;
&lt;p&gt;But what happens when you find yourself writing the &lt;em&gt;same&lt;/em&gt; &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt; logic in multiple components? Perhaps you have several components that all need to fetch data from a similar API endpoint, or they all need to manage a toggle state with similar side effects. Copy-pasting code is a common anti-pattern that leads to &amp;ldquo;boilerplate&amp;rdquo; and makes your application harder to maintain.&lt;/p&gt;</description></item></channel></rss>