<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Usama</title>
    <description>The latest articles on DEV Community by Usama (@usama_dev).</description>
    <link>https://dev.to/usama_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3445914%2F2718075f-dedb-41bc-ad21-44e8d0713ad5.jpg</url>
      <title>DEV Community: Usama</title>
      <link>https://dev.to/usama_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usama_dev"/>
    <language>en</language>
    <item>
      <title>What is a Transient Prop?</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Wed, 08 Jul 2026 19:23:54 +0000</pubDate>
      <link>https://dev.to/usama_dev/what-is-a-transient-prop-2pkj</link>
      <guid>https://dev.to/usama_dev/what-is-a-transient-prop-2pkj</guid>
      <description>&lt;p&gt;A &lt;strong&gt;transient prop&lt;/strong&gt; is a special prop in &lt;strong&gt;styled-components&lt;/strong&gt; that starts with a dollar sign (&lt;code&gt;$&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StyledRow&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1fr 2fr 1fr"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the styled component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StyledRow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  grid-template-columns: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$columns&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;$&lt;/code&gt; tells styled-components:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"This prop is only for styling. Do not pass it to the HTML element."&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Why do Transient Props exist?
&lt;/h2&gt;

&lt;p&gt;Sometimes we pass values only to generate CSS.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Number of grid columns&lt;/li&gt;
&lt;li&gt;Background color&lt;/li&gt;
&lt;li&gt;Padding&lt;/li&gt;
&lt;li&gt;Width&lt;/li&gt;
&lt;li&gt;Border radius&lt;/li&gt;
&lt;li&gt;Active state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These values are needed by styled-components, but the browser's HTML elements (&lt;code&gt;div&lt;/code&gt;, &lt;code&gt;button&lt;/code&gt;, &lt;code&gt;section&lt;/code&gt;, etc.) do not understand them.&lt;/p&gt;

&lt;p&gt;Without transient props, React forwards those props to the DOM, which causes warnings like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Warning: Unknown prop "columns" on &amp;lt;div&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Transient props solve this problem by keeping styling props inside styled-components and preventing them from reaching the DOM.&lt;/p&gt;




&lt;h2&gt;
  
  
  Normal Prop vs Transient Prop
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Normal Prop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StyledRow&lt;/span&gt; &lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1fr 2fr"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StyledRow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  grid-template-columns: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React renders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;columns=&lt;/span&gt;&lt;span class="s"&gt;"1fr 2fr"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since &lt;code&gt;columns&lt;/code&gt; is not a valid HTML attribute, React shows a warning.&lt;/p&gt;




&lt;h3&gt;
  
  
  Transient Prop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StyledRow&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1fr 2fr"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StyledRow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  grid-template-columns: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$columns&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React renders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;$columns&lt;/code&gt; prop is used only by styled-components to generate CSS and is &lt;strong&gt;not&lt;/strong&gt; passed to the DOM.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Normal Prop&lt;/th&gt;
&lt;th&gt;Transient Prop&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;columns&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;$columns&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Passed to the DOM&lt;/td&gt;
&lt;td&gt;Not passed to the DOM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can trigger React warnings&lt;/td&gt;
&lt;td&gt;Prevents React warnings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used for component logic or data&lt;/td&gt;
&lt;td&gt;Used only for styling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  When Should You Use Transient Props?
&lt;/h2&gt;

&lt;p&gt;Use transient props whenever a prop is &lt;strong&gt;only needed for styling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;primary&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Card&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;active&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Box&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"2rem"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Grid&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"1fr 2fr 1fr"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the prop is only used to create CSS and should not become an HTML attribute, make it a transient prop by adding the &lt;code&gt;$&lt;/code&gt; prefix.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;A transient prop is a styled-components feature that uses the &lt;code&gt;$&lt;/code&gt; prefix to mark styling-only props. These props are available inside the styled component but are not forwarded to the browser's HTML elements. This keeps the DOM clean, avoids React warnings, and makes your components easier to maintain.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>I Almost Gave Up... But One Console Log Changed Everything</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sat, 04 Jul 2026 19:05:28 +0000</pubDate>
      <link>https://dev.to/usama_dev/i-almost-gave-up-but-one-console-log-changed-everything-2l23</link>
      <guid>https://dev.to/usama_dev/i-almost-gave-up-but-one-console-log-changed-everything-2l23</guid>
      <description>&lt;p&gt;Today I spent hours chasing a bug that looked impossible.&lt;/p&gt;

&lt;p&gt;When I clicked &lt;strong&gt;"Add Cabin"&lt;/strong&gt;, nothing happened.&lt;/p&gt;

&lt;p&gt;No modal.&lt;/p&gt;

&lt;p&gt;No error.&lt;/p&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;At first, I thought the problem was in my React state.&lt;/p&gt;

&lt;p&gt;Then I thought it was &lt;code&gt;styled-components&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then I suspected &lt;code&gt;PropTypes&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I kept changing code, but the bug was still there.&lt;/p&gt;

&lt;p&gt;Instead of randomly editing files, I decided to debug step by step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Check if the button works
&lt;/h2&gt;

&lt;p&gt;I added a simple log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Button clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The console printed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Button clicked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great!&lt;/p&gt;

&lt;p&gt;That meant the click event was working.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Check the modal state
&lt;/h2&gt;

&lt;p&gt;Next, I logged my modal state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;openName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I expected to see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;openName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cabin-form"&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cabin-form"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, I noticed something strange.&lt;/p&gt;

&lt;p&gt;The value became &lt;code&gt;"cabin-form"&lt;/code&gt; for only a moment, then immediately changed back to an empty string.&lt;/p&gt;

&lt;p&gt;That was the biggest clue.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Ask the right question
&lt;/h2&gt;

&lt;p&gt;Instead of asking,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why doesn't the modal open?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I started asking,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Who is closing the modal immediately?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That changed everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Find the real culprit
&lt;/h2&gt;

&lt;p&gt;The problem wasn't React.&lt;/p&gt;

&lt;p&gt;It wasn't the modal.&lt;/p&gt;

&lt;p&gt;It wasn't &lt;code&gt;styled-components&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It was my outside click handler.&lt;/p&gt;

&lt;p&gt;I had this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handleClickOutside&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same click that opened the modal was also triggering the outside click listener, so the modal closed instantly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: The fix
&lt;/h2&gt;

&lt;p&gt;I changed it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mousedown&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handleClickOutside&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And suddenly...&lt;/p&gt;

&lt;p&gt;The modal opened perfectly.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Today taught me a lesson I'll remember for a long time.&lt;/p&gt;

&lt;p&gt;Debugging isn't about guessing.&lt;/p&gt;

&lt;p&gt;It's about collecting evidence.&lt;/p&gt;

&lt;p&gt;Every &lt;code&gt;console.log()&lt;/code&gt; is a clue.&lt;/p&gt;

&lt;p&gt;Every observation eliminates another possibility.&lt;/p&gt;

&lt;p&gt;The goal isn't to write more code.&lt;/p&gt;

&lt;p&gt;The goal is to understand what the code is actually doing.&lt;/p&gt;

&lt;p&gt;Today I didn't just fix a modal.&lt;/p&gt;

&lt;p&gt;I learned how experienced developers think when they debug.&lt;/p&gt;

&lt;p&gt;And that lesson is worth much more than fixing a single bug.&lt;/p&gt;

</description>
      <category>react</category>
      <category>softwaredevelopment</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why I Started Learning React Query (TanStack Query) Today</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sat, 20 Jun 2026 11:00:21 +0000</pubDate>
      <link>https://dev.to/usama_dev/why-i-started-learning-react-query-tanstack-query-today-5ceg</link>
      <guid>https://dev.to/usama_dev/why-i-started-learning-react-query-tanstack-query-today-5ceg</guid>
      <description>&lt;p&gt;Today I started learning something that honestly changed the way I think about React apps: &lt;strong&gt;React Query&lt;/strong&gt;, now known as &lt;strong&gt;TanStack Query&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first, I thought it was just another state management tool like Redux. But it’s not.&lt;br&gt;
It solves a &lt;em&gt;completely different problem&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;And if you are building React apps, especially with APIs, this is one of those tools that quietly removes a lot of pain.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Real Problem It Solves (What I Didn’t Understand Before)
&lt;/h2&gt;

&lt;p&gt;In React apps, we usually deal with two types of state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UI state&lt;/strong&gt; → buttons, modals, inputs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server state&lt;/strong&gt; → data from APIs (users, posts, products, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most developers (including me at first) try to manage server state using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;useState&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;useEffect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Redux&lt;/li&gt;
&lt;li&gt;Context API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And it becomes messy fast.&lt;/p&gt;

&lt;p&gt;Because server state is not simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It changes&lt;/li&gt;
&lt;li&gt;It needs caching&lt;/li&gt;
&lt;li&gt;It needs refetching&lt;/li&gt;
&lt;li&gt;It can fail&lt;/li&gt;
&lt;li&gt;It should sync across screens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where &lt;strong&gt;TanStack Query&lt;/strong&gt; comes in.&lt;/p&gt;


&lt;h2&gt;
  
  
  What React Query Actually Is
&lt;/h2&gt;

&lt;p&gt;React Query is NOT a traditional state manager.&lt;/p&gt;

&lt;p&gt;It is a &lt;strong&gt;server-state manager&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It automatically handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching data&lt;/li&gt;
&lt;li&gt;Caching responses&lt;/li&gt;
&lt;li&gt;Updating stale data&lt;/li&gt;
&lt;li&gt;Background refetching&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;li&gt;Loading states&lt;/li&gt;
&lt;li&gt;Retry logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don’t manually build all of this anymore.&lt;/p&gt;

&lt;p&gt;Instead of writing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;loading state&lt;/li&gt;
&lt;li&gt;error state&lt;/li&gt;
&lt;li&gt;fetch logic&lt;/li&gt;
&lt;li&gt;cache logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You just declare the data you need.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Big Idea (Simple Explanation)
&lt;/h2&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Instead of you managing data manually, React Query creates a smart cache layer between your UI and API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So your UI always asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Do I already have this data?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If yes → it gives cached data instantly&lt;br&gt;
If no → it fetches it, stores it, and updates UI automatically&lt;/p&gt;

&lt;p&gt;This is why apps feel faster.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Makes It Powerful
&lt;/h2&gt;

&lt;p&gt;Here’s what impressed me the most:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Caching (Automatic Memory)
&lt;/h3&gt;

&lt;p&gt;Once data is fetched:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it is stored in cache&lt;/li&gt;
&lt;li&gt;reused instantly next time&lt;/li&gt;
&lt;li&gt;no unnecessary API calls&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  2. Background Refetching
&lt;/h3&gt;

&lt;p&gt;Even if data is shown from cache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it silently updates in background&lt;/li&gt;
&lt;li&gt;UI stays fresh without flickering&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  3. Auto Loading &amp;amp; Error States
&lt;/h3&gt;

&lt;p&gt;You don’t manually write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;loading&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;setLoading&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;try/catch&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;isLoading&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isError&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;error&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  4. Refetching Smartly
&lt;/h3&gt;

&lt;p&gt;It can refetch when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;window refocuses&lt;/li&gt;
&lt;li&gt;network reconnects&lt;/li&gt;
&lt;li&gt;time interval passes&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  5. Prefetching
&lt;/h3&gt;

&lt;p&gt;You can load data before user even clicks:&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user hovers button → data already loaded&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That feels like “instant app speed”.&lt;/p&gt;


&lt;h3&gt;
  
  
  6. Offline Support
&lt;/h3&gt;

&lt;p&gt;Even when internet is weak:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cached data still shows&lt;/li&gt;
&lt;li&gt;UI doesn’t break instantly&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  A Small Mental Shift I Had
&lt;/h2&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I need to manage API data manually”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I just describe what data I need”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That shift is huge.&lt;/p&gt;


&lt;h2&gt;
  
  
  Simple Example (How It Feels in Code)
&lt;/h2&gt;

&lt;p&gt;Instead of writing complex &lt;code&gt;useEffect&lt;/code&gt;, now it looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;queryKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;queryFn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fetchUsers&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;No loading state. No manual caching. No extra logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  Alternatives You Should Know
&lt;/h2&gt;

&lt;p&gt;React Query is not the only solution. Here are other tools in the ecosystem:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Redux Toolkit
&lt;/h3&gt;

&lt;p&gt;Redux Toolkit&lt;br&gt;
Good for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;global UI state&lt;/li&gt;
&lt;li&gt;complex app logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But not great for server-state by default.&lt;/p&gt;




&lt;h4&gt;
  
  
  2. RTK Query
&lt;/h4&gt;

&lt;p&gt;Part of Redux Toolkit&lt;br&gt;
It actually competes directly with React Query.&lt;/p&gt;

&lt;p&gt;Good for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API data handling inside Redux ecosystem&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  3. SWR
&lt;/h4&gt;

&lt;p&gt;SWR&lt;br&gt;
Simple alternative to React Query:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lightweight&lt;/li&gt;
&lt;li&gt;easy caching&lt;/li&gt;
&lt;li&gt;less features than TanStack Query&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Apollo Client (GraphQL)
&lt;/h3&gt;

&lt;p&gt;Apollo Client&lt;br&gt;
Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GraphQL APIs&lt;/li&gt;
&lt;li&gt;complex data graphs&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. AWS Amplify (Backend approach)
&lt;/h3&gt;

&lt;p&gt;Amazon Web Services&lt;br&gt;
Not just state management, but full backend solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;auth&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it’s heavier and not just frontend state handling.&lt;/p&gt;




&lt;h2&gt;
  
  
  When You Should Use React Query
&lt;/h2&gt;

&lt;p&gt;Use it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you work with REST APIs&lt;/li&gt;
&lt;li&gt;you want fast UI experience&lt;/li&gt;
&lt;li&gt;you want less boilerplate&lt;/li&gt;
&lt;li&gt;you care about caching &amp;amp; performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don’t use it for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;simple static apps&lt;/li&gt;
&lt;li&gt;only UI state (useState is enough)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why I Think This Is Important for Developers
&lt;/h2&gt;

&lt;p&gt;Modern frontend is not just UI anymore.&lt;/p&gt;

&lt;p&gt;It’s about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;performance&lt;/li&gt;
&lt;li&gt;caching strategy&lt;/li&gt;
&lt;li&gt;data synchronization&lt;/li&gt;
&lt;li&gt;user experience speed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React Query handles all of this behind the scenes.&lt;/p&gt;

&lt;p&gt;And that’s why it feels like a “missing layer” in React.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought (From My Learning Today)
&lt;/h2&gt;

&lt;p&gt;I’m currently learning React seriously, especially through courses by &lt;a href="https://www.udemy.com/course/the-ultimate-react-course/#instructor-1" rel="noopener noreferrer"&gt;Jonas Schmedtmann&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And one thing I’m realizing is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Writing less code is not the goal.&lt;br&gt;
Writing &lt;em&gt;smarter systems&lt;/em&gt; is.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;React Query is exactly that kind of tool.&lt;/p&gt;

&lt;p&gt;It removes repetitive work so you can focus on building real features.&lt;/p&gt;




&lt;p&gt;If I had to summarize it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;React Query is not just a library.&lt;br&gt;
It’s a mindset shift in how you handle data in React.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>reactquery</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Tailwind CSS?</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sun, 10 May 2026 19:50:13 +0000</pubDate>
      <link>https://dev.to/usama_dev/what-is-tailwind-css-2opk</link>
      <guid>https://dev.to/usama_dev/what-is-tailwind-css-2opk</guid>
      <description>&lt;p&gt;&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Tailwind CSS&lt;/a&gt; is a &lt;strong&gt;utility-first CSS framework&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It gives us ready-made utility classes like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;flex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;text-center&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p-4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rotate-90&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We use these classes directly inside HTML or JSX to build designs quickly.&lt;/p&gt;

&lt;p&gt;Instead of writing custom CSS again and again, Tailwind already provides hundreds of small reusable classes.&lt;/p&gt;




&lt;h2&gt;
  
  
  What does “Utility-First” mean?
&lt;/h2&gt;

&lt;p&gt;A utility class does &lt;strong&gt;one small job only&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;w-12&lt;/code&gt; → sets width&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h-12&lt;/code&gt; → sets height&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;text-center&lt;/code&gt; → centers text&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex&lt;/code&gt; → makes flexbox layout&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We combine many small classes together to create complete layouts and designs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Easy Way to Remember
&lt;/h2&gt;

&lt;p&gt;Think like this:&lt;/p&gt;

&lt;h3&gt;
  
  
  Normal CSS
&lt;/h3&gt;

&lt;p&gt;You write your own CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.box&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;48px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;48px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Tailwind CSS
&lt;/h3&gt;

&lt;p&gt;You use ready-made classes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-12 h-12 flex"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So Tailwind means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Don’t write CSS from scratch. Use small ready-made classes.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  One-Line Memory Trick
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Tailwind CSS = Small ready-made classes combined together to build any design quickly.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  How Tailwind Utility Classes Work
&lt;/h2&gt;

&lt;p&gt;In Tailwind CSS, classes like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;w-12
h-12
flex
text-center
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;already have CSS written behind the scenes.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.w-12&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.h-12&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Important Part
&lt;/h2&gt;

&lt;p&gt;If you use &lt;code&gt;w-12&lt;/code&gt; 100 times in your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tailwind does NOT create the CSS 100 times.&lt;/p&gt;

&lt;p&gt;The CSS rule for &lt;code&gt;.w-12&lt;/code&gt; is written only once.&lt;/p&gt;

&lt;p&gt;Then every element simply reuses that same class.&lt;/p&gt;




&lt;h2&gt;
  
  
  So What Is the Benefit?
&lt;/h2&gt;

&lt;p&gt;Instead of writing this again and again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.box&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tailwind gives one reusable utility:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.w-12&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and everything shares it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Easy Understanding
&lt;/h3&gt;

&lt;p&gt;Think of utility classes like LEGO pieces.&lt;/p&gt;

&lt;p&gt;You do not create a new LEGO block every time.&lt;/p&gt;

&lt;p&gt;You reuse the same block in many places.&lt;/p&gt;

&lt;p&gt;Tailwind utilities work the same way.&lt;/p&gt;




&lt;h4&gt;
  
  
  Final Simple Definition
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Utility-first CSS means using small reusable classes that already contain one CSS property, and reusing them everywhere instead of writing new CSS repeatedly.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tailwindcss</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>The Hardest Phase in Development No One Talks About</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sun, 12 Apr 2026 16:07:49 +0000</pubDate>
      <link>https://dev.to/usama_dev/the-hardest-phase-in-development-no-one-talks-about-1c6g</link>
      <guid>https://dev.to/usama_dev/the-hardest-phase-in-development-no-one-talks-about-1c6g</guid>
      <description>&lt;p&gt;When people think about software development, they usually imagine one thing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coding.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Writing functions.&lt;br&gt;&lt;br&gt;
Fixing bugs.&lt;br&gt;&lt;br&gt;
Building UI.  &lt;/p&gt;

&lt;p&gt;And yes, that part is hard… in the beginning.&lt;/p&gt;

&lt;p&gt;But after spending enough time—months, maybe a year—you realize something uncomfortable:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Coding is not the hardest part anymore.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Phase That Breaks You
&lt;/h2&gt;

&lt;p&gt;Right now, I’m going through a phase that feels completely different.&lt;/p&gt;

&lt;p&gt;I can code.&lt;br&gt;&lt;br&gt;
I can build components.&lt;br&gt;&lt;br&gt;
I can follow tutorials.&lt;br&gt;&lt;br&gt;
I can even complete projects.&lt;/p&gt;

&lt;p&gt;But when I sit down to build something &lt;strong&gt;on my own from scratch&lt;/strong&gt;, my mind goes blank.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What should I build first?&lt;/li&gt;
&lt;li&gt;How should I structure this system?&lt;/li&gt;
&lt;li&gt;How will different parts connect?&lt;/li&gt;
&lt;li&gt;What happens when this scales?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the phase I call:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Architecture Thinking&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And honestly… it’s painful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Phase Feels So Difficult
&lt;/h2&gt;

&lt;p&gt;Because suddenly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is &lt;strong&gt;no step-by-step guide&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;There is &lt;strong&gt;no exact tutorial&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;There is &lt;strong&gt;no copy-paste solution&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You are forced to think.&lt;/p&gt;

&lt;p&gt;Not just write code—but &lt;strong&gt;design systems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that’s a completely different skill.&lt;/p&gt;




&lt;h2&gt;
  
  
  You Can’t Learn This From Tutorials Alone
&lt;/h2&gt;

&lt;p&gt;This is something I’ve realized the hard way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;YouTube can teach syntax
&lt;/li&gt;
&lt;li&gt;Courses can teach frameworks
&lt;/li&gt;
&lt;li&gt;AI can help you debug
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But &lt;strong&gt;none of them can fully teach you how to think like an engineer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because architecture thinking is not about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“How to write code”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“What code should exist in the first place?”&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Truth No One Tells You
&lt;/h2&gt;

&lt;p&gt;There is no single:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Perfect course
&lt;/li&gt;
&lt;li&gt;Perfect book
&lt;/li&gt;
&lt;li&gt;Perfect roadmap
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That will magically give you this skill.&lt;/p&gt;

&lt;p&gt;Because this phase requires something uncomfortable:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Struggling with unclear problems.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Current Approach (Still Learning)
&lt;/h2&gt;

&lt;p&gt;I’m not an expert yet.&lt;br&gt;&lt;br&gt;
I’m still in this phase.&lt;br&gt;&lt;br&gt;
Still confused. Still learning.&lt;/p&gt;

&lt;p&gt;But one thing is slowly helping me:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Start With the Big Picture
&lt;/h3&gt;

&lt;p&gt;Before writing code, I try to ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the goal of this system?&lt;/li&gt;
&lt;li&gt;Who is using it?&lt;/li&gt;
&lt;li&gt;What are the main parts?&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Break It Into Small Pieces
&lt;/h3&gt;

&lt;p&gt;Instead of thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Build entire app”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Dashboard&lt;/li&gt;
&lt;li&gt;Data flow&lt;/li&gt;
&lt;li&gt;API structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small, understandable chunks.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Think Before Coding
&lt;/h3&gt;

&lt;p&gt;Earlier, I used to jump directly into coding.&lt;/p&gt;

&lt;p&gt;Now I try to pause and ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why this approach?&lt;/li&gt;
&lt;li&gt;Is there a simpler way?&lt;/li&gt;
&lt;li&gt;What will break later?&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Accept the Pain
&lt;/h3&gt;

&lt;p&gt;This is the hardest part.&lt;/p&gt;

&lt;p&gt;Because this phase feels like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow progress
&lt;/li&gt;
&lt;li&gt;Confusion
&lt;/li&gt;
&lt;li&gt;Self-doubt
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But I’m starting to believe:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This pain is a sign of growth.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Where I Stand Right Now
&lt;/h2&gt;

&lt;p&gt;I’m not someone who has mastered architecture.&lt;/p&gt;

&lt;p&gt;I’m someone who is &lt;strong&gt;experiencing it for the first time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And it’s uncomfortable.&lt;/p&gt;

&lt;p&gt;But it also feels like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m finally moving from “coder” → “engineer”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;If you’re also feeling stuck at this stage…&lt;/p&gt;

&lt;p&gt;If coding feels easy but building systems feels impossible…&lt;/p&gt;

&lt;p&gt;Then maybe you’re not lost.&lt;/p&gt;

&lt;p&gt;Maybe…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You’ve just entered the hardest phase of development.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that’s exactly where real growth begins.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>I Had to Stop Writing to Start Understanding</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Thu, 02 Apr 2026 16:09:23 +0000</pubDate>
      <link>https://dev.to/usama_dev/i-had-to-stop-writing-to-start-understanding-41ap</link>
      <guid>https://dev.to/usama_dev/i-had-to-stop-writing-to-start-understanding-41ap</guid>
      <description>&lt;p&gt;I didn’t plan this.&lt;/p&gt;

&lt;p&gt;I started writing blogs because I wanted my message to reach beyond my circle. I wanted to help people — even if it was in a small way. Writing felt like a bridge between what I was learning and what others might need.&lt;/p&gt;

&lt;p&gt;But now… I’ve decided to stop. At least for a while.&lt;/p&gt;

&lt;p&gt;Not because I’ve lost interest.&lt;br&gt;
Not because I’ve run out of ideas.&lt;/p&gt;

&lt;p&gt;But because I finally understood something uncomfortable:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I know concepts… but I don’t truly understand them.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Illusion of Knowing
&lt;/h2&gt;

&lt;p&gt;As developers, we often feel like we “get it.”&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can build a UI&lt;/li&gt;
&lt;li&gt;We can use state&lt;/li&gt;
&lt;li&gt;We can set up routing&lt;/li&gt;
&lt;li&gt;We can make things work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But is that enough?&lt;/p&gt;

&lt;p&gt;I realized something while working:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Knowing &lt;em&gt;how&lt;/em&gt; to do something is very different from knowing &lt;em&gt;why&lt;/em&gt;, &lt;em&gt;when&lt;/em&gt;, and &lt;em&gt;what happens if it breaks&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Everyone can create a UI.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can you design a UI that aligns with how a client &lt;em&gt;thinks&lt;/em&gt;?&lt;/li&gt;
&lt;li&gt;Can you predict where it might fail?&lt;/li&gt;
&lt;li&gt;Can you explain your UI decisions clearly to a non-technical person?&lt;/li&gt;
&lt;li&gt;Can you design interactions that feel natural instead of forced?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s a completely different level.&lt;/p&gt;

&lt;p&gt;And I’m not there yet.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Gap: Depth
&lt;/h2&gt;

&lt;p&gt;Right now, my biggest struggle is not learning new things.&lt;/p&gt;

&lt;p&gt;It’s &lt;strong&gt;going deep into the things I already “know.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some concepts take:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2 days&lt;/li&gt;
&lt;li&gt;3 days&lt;/li&gt;
&lt;li&gt;Sometimes even more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And still… they don’t fully click.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State management (beyond basic usage)&lt;/li&gt;
&lt;li&gt;Routing logic and data flow&lt;/li&gt;
&lt;li&gt;Component architecture&lt;/li&gt;
&lt;li&gt;UI behavior under edge cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not things you can “finish” in a day and write a blog about.&lt;/p&gt;

&lt;p&gt;They demand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Isolation&lt;/li&gt;
&lt;li&gt;Focus&lt;/li&gt;
&lt;li&gt;Repetition&lt;/li&gt;
&lt;li&gt;Failure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly… patience.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I’m Pausing My Blogs
&lt;/h2&gt;

&lt;p&gt;I used to write regularly.&lt;/p&gt;

&lt;p&gt;But now I’ve realized:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Writing fast is slowing down my understanding.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If I keep pushing myself to write weekly or daily:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I’ll only explain surface-level ideas&lt;/li&gt;
&lt;li&gt;I’ll repeat what others are already saying&lt;/li&gt;
&lt;li&gt;I won’t grow beyond a certain point&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s not what I want anymore.&lt;/p&gt;

&lt;p&gt;So I made a hard decision:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I will write less… but understand more.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A Shift in Identity
&lt;/h2&gt;

&lt;p&gt;Earlier, I was writing as a &lt;em&gt;learner documenting the journey&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now, I want to write as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Someone who has struggled with a concept long enough to truly understand it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not just:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Here’s how you use it”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Here’s how it breaks”&lt;/li&gt;
&lt;li&gt;“Here’s what nobody tells you”&lt;/li&gt;
&lt;li&gt;“Here’s what actually matters in real projects”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That kind of writing takes time.&lt;/p&gt;

&lt;p&gt;And right now, I need that time for myself.&lt;/p&gt;




&lt;h2&gt;
  
  
  About AI and Fear
&lt;/h2&gt;

&lt;p&gt;There’s another pressure we all feel today.&lt;/p&gt;

&lt;p&gt;AI.&lt;/p&gt;

&lt;p&gt;Everywhere you look, there’s noise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“AI will replace developers”&lt;/li&gt;
&lt;li&gt;“Learn faster or fall behind”&lt;/li&gt;
&lt;li&gt;“Do more in less time”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly… it’s overwhelming.&lt;/p&gt;

&lt;p&gt;But I’ve come to a simple belief:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you’re doing something, do it with your heart.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because in the end:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools will change&lt;/li&gt;
&lt;li&gt;Trends will change&lt;/li&gt;
&lt;li&gt;Speed will change&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But &lt;strong&gt;depth will always matter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can generate code.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can it understand your client deeply?&lt;/li&gt;
&lt;li&gt;Can it feel the friction in a user experience?&lt;/li&gt;
&lt;li&gt;Can it make intentional decisions for your product?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s where we still matter.&lt;/p&gt;




&lt;h2&gt;
  
  
  This Is Not an End
&lt;/h2&gt;

&lt;p&gt;I’m not quitting writing.&lt;/p&gt;

&lt;p&gt;I’m just… stepping back.&lt;/p&gt;

&lt;p&gt;Learning slowly.&lt;br&gt;
Understanding deeply.&lt;br&gt;
Building real clarity.&lt;/p&gt;

&lt;p&gt;And when I come back:&lt;/p&gt;

&lt;p&gt;It won’t be frequent.&lt;/p&gt;

&lt;p&gt;But it will be real.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;If you’re in the same place — feeling like you “know things” but not deeply enough…&lt;/p&gt;

&lt;p&gt;You’re not behind.&lt;/p&gt;

&lt;p&gt;You’re just at the point where real learning begins.&lt;/p&gt;

&lt;p&gt;Take your time.&lt;/p&gt;

&lt;p&gt;Go deeper.&lt;/p&gt;

&lt;p&gt;And don’t rush your growth just to stay visible.&lt;/p&gt;

&lt;p&gt;Because sometimes…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Silence builds stronger developers than noise ever can.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>learning</category>
      <category>programming</category>
      <category>writing</category>
    </item>
    <item>
      <title>The Day I Finally Understood `useActionData` (React Router)</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sun, 29 Mar 2026 12:46:59 +0000</pubDate>
      <link>https://dev.to/usama_dev/the-day-i-finally-understood-useactiondata-react-router-51ao</link>
      <guid>https://dev.to/usama_dev/the-day-i-finally-understood-useactiondata-react-router-51ao</guid>
      <description>&lt;p&gt;There are some concepts in programming that don’t just confuse you… they &lt;em&gt;haunt&lt;/em&gt; you.&lt;/p&gt;

&lt;p&gt;For me, one of those concepts was &lt;strong&gt;&lt;code&gt;useActionData&lt;/code&gt; in React Router&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I remember clearly — when I first learned it, everything made sense. I implemented it, it worked, and I moved on.&lt;/p&gt;

&lt;p&gt;But then…&lt;/p&gt;

&lt;p&gt;A few days later, I opened my old code, looked at it, and thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What is this doing… and why did I even write this?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Confusion
&lt;/h2&gt;

&lt;p&gt;I even tried reading the definition again:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Returns the data from the last action.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simple sentence.&lt;br&gt;
Zero clarity.&lt;/p&gt;

&lt;p&gt;I watched YouTube videos.&lt;br&gt;
Still confused.&lt;/p&gt;

&lt;p&gt;I checked my own code.&lt;br&gt;
Even more confused.&lt;/p&gt;

&lt;p&gt;At that point, I realized something important:&lt;/p&gt;

&lt;p&gt;👉 I didn’t need &lt;em&gt;more information&lt;/em&gt;&lt;br&gt;
👉 I needed a &lt;strong&gt;clear mental model&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Let’s Break It Down (In Simple Language)
&lt;/h2&gt;

&lt;p&gt;Think of &lt;code&gt;useActionData&lt;/code&gt; like this:&lt;/p&gt;

&lt;p&gt;👉 It is a way to &lt;strong&gt;get the result of a form submission handled by React Router&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Flow (Step-by-Step)
&lt;/h2&gt;

&lt;p&gt;Let me explain what actually happens behind the scenes.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. You create a form using React Router
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Submit&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a normal form.&lt;/p&gt;

&lt;p&gt;This form is connected to React Router.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. You define an &lt;code&gt;action&lt;/code&gt; function in your route
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;action&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Username is required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Form submitted successfully&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This &lt;code&gt;action&lt;/code&gt; runs when the form is submitted&lt;br&gt;
👉 It processes the data&lt;br&gt;
👉 It returns something (important!)&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Now comes &lt;code&gt;useActionData&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useActionData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This hook gives you &lt;strong&gt;whatever the action returned&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Key Idea (THIS is what I was missing)
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;useActionData&lt;/code&gt; = &lt;strong&gt;“Show me the result of my last form submission”&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Do We Even Need It?
&lt;/h2&gt;

&lt;p&gt;Because after submitting a form, we often want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show errors (validation)&lt;/li&gt;
&lt;li&gt;Show success messages&lt;/li&gt;
&lt;li&gt;Show server responses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And React Router gives us a clean way to do that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real Example (Now It Makes Sense)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useActionData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"username"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Submit&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What’s Actually Happening?
&lt;/h2&gt;

&lt;p&gt;Let me say it in &lt;em&gt;very simple words&lt;/em&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User submits the form&lt;/li&gt;
&lt;li&gt;React Router calls the &lt;code&gt;action&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;action&lt;/code&gt; processes data and returns something&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;useActionData&lt;/code&gt; receives that return value&lt;/li&gt;
&lt;li&gt;UI updates based on it&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Mistake I Was Making
&lt;/h2&gt;

&lt;p&gt;I was thinking:&lt;/p&gt;

&lt;p&gt;❌ “This is some complicated magic function”&lt;/p&gt;

&lt;p&gt;But in reality:&lt;/p&gt;

&lt;p&gt;✅ It’s just a &lt;strong&gt;bridge between backend logic (action) and UI&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  One Line Summary (For Future Me)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;useActionData&lt;/code&gt; is used to &lt;strong&gt;access and display the result of a form submission handled by a route action.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  When Should You Use It?
&lt;/h2&gt;

&lt;p&gt;Use it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You are using &lt;code&gt;&amp;lt;Form&amp;gt;&lt;/code&gt; from React Router&lt;/li&gt;
&lt;li&gt;You have an &lt;code&gt;action&lt;/code&gt; function&lt;/li&gt;
&lt;li&gt;You want to show &lt;strong&gt;errors or results without manual state&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  When NOT to Use It
&lt;/h2&gt;

&lt;p&gt;Don’t use it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re using normal React forms (&lt;code&gt;onSubmit&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;You’re handling everything with &lt;code&gt;useState&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;action&lt;/code&gt; function is involved&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;This concept confused me not because it was hard…&lt;/p&gt;

&lt;p&gt;…but because I didn’t understand the &lt;strong&gt;flow&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now I do.&lt;/p&gt;

&lt;p&gt;And if future me ever gets confused again:&lt;/p&gt;

&lt;p&gt;👉 Just remember:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Form → Action → Return → useActionData → UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s the whole story.&lt;/p&gt;

</description>
      <category>react</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Week 24: Redux Toolkit Finally Made Redux Feel Simple + Deep Dive into React Router Data Fetching</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Wed, 25 Mar 2026 16:24:32 +0000</pubDate>
      <link>https://dev.to/usama_dev/week-24-redux-toolkit-finally-made-redux-feel-simple-deep-dive-into-react-router-data-fetching-2efl</link>
      <guid>https://dev.to/usama_dev/week-24-redux-toolkit-finally-made-redux-feel-simple-deep-dive-into-react-router-data-fetching-2efl</guid>
      <description>&lt;p&gt;This week felt like a shift.&lt;/p&gt;

&lt;p&gt;Not because I learned something completely new…&lt;br&gt;
But because things that once felt complex &lt;strong&gt;started becoming simple&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I moved from classic Redux to &lt;strong&gt;Redux Toolkit&lt;/strong&gt;, and at the same time, I started understanding &lt;strong&gt;React Router at a deeper level&lt;/strong&gt; — especially how data fetching actually works.&lt;/p&gt;




&lt;h2&gt;
  
  
  From Redux Complexity to Redux Toolkit Simplicity
&lt;/h2&gt;

&lt;p&gt;Before this week, Redux felt structured… but heavy.&lt;/p&gt;

&lt;p&gt;For a single feature, I had to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;action types&lt;/li&gt;
&lt;li&gt;action creators&lt;/li&gt;
&lt;li&gt;reducers&lt;/li&gt;
&lt;li&gt;store setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It worked, but it didn’t feel efficient.&lt;/p&gt;

&lt;p&gt;Then I started using &lt;strong&gt;Redux Toolkit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And honestly… it changed how I see Redux.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Moment Redux Toolkit Clicked
&lt;/h2&gt;

&lt;p&gt;Two things made the biggest difference for me:&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ &lt;code&gt;configureStore&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Earlier, setting up a store required multiple functions.&lt;/p&gt;

&lt;p&gt;Now it’s just:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one clean configuration&lt;/li&gt;
&lt;li&gt;everything handled internally&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No unnecessary setup.&lt;br&gt;
No confusion.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ &lt;code&gt;createSlice&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This was the biggest upgrade.&lt;/p&gt;

&lt;p&gt;Instead of writing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;action types&lt;/li&gt;
&lt;li&gt;action creators&lt;/li&gt;
&lt;li&gt;reducers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can now define everything in one place.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;p&gt;👉 Less boilerplate&lt;br&gt;
👉 Cleaner code&lt;br&gt;
👉 Better structure&lt;/p&gt;

&lt;p&gt;For the first time, Redux felt &lt;strong&gt;practical&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Middleware &amp;amp; Thunks — Real-World Logic
&lt;/h2&gt;

&lt;p&gt;I continued working with &lt;strong&gt;Redux Thunk&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This helped me understand how Redux handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API calls&lt;/li&gt;
&lt;li&gt;async logic&lt;/li&gt;
&lt;li&gt;delayed actions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of putting everything inside components, I started moving logic into Redux.&lt;/p&gt;

&lt;p&gt;This made my components:&lt;/p&gt;

&lt;p&gt;👉 cleaner&lt;br&gt;
👉 easier to manage&lt;/p&gt;




&lt;h2&gt;
  
  
  React Router — Not Just Navigation Anymore
&lt;/h2&gt;

&lt;p&gt;This week I also went deeper into &lt;strong&gt;React Router&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before, I used it only for navigation.&lt;/p&gt;

&lt;p&gt;Now I started understanding:&lt;/p&gt;

&lt;p&gt;👉 It’s not just routing&lt;br&gt;
👉 It’s also about &lt;strong&gt;data flow&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding &lt;code&gt;createBrowserRouter&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Instead of defining routes in a simple way, I explored a more structured approach.&lt;/p&gt;

&lt;p&gt;Routes now feel like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a configuration system&lt;/li&gt;
&lt;li&gt;not just components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes large applications easier to manage.&lt;/p&gt;




&lt;h2&gt;
  
  
  Data Fetching with React Router (Big Realization)
&lt;/h2&gt;

&lt;p&gt;This was the most interesting part of the week.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;I used to fetch data inside components using &lt;code&gt;useEffect&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;React Router allows fetching data &lt;strong&gt;before the component renders&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;better user experience&lt;/li&gt;
&lt;li&gt;cleaner components&lt;/li&gt;
&lt;li&gt;more predictable data flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This felt like a more &lt;strong&gt;professional approach&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Changed for Me This Week
&lt;/h2&gt;

&lt;p&gt;Before Week 24:&lt;/p&gt;

&lt;p&gt;Redux felt heavy.&lt;br&gt;
Routing felt basic.&lt;/p&gt;

&lt;p&gt;After Week 24:&lt;/p&gt;

&lt;p&gt;Redux feels &lt;strong&gt;simpler and cleaner&lt;/strong&gt;.&lt;br&gt;
Routing feels &lt;strong&gt;more powerful and structured&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Redux Toolkit reduces unnecessary complexity&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;configureStore&lt;/code&gt; simplifies setup&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;createSlice&lt;/code&gt; organizes everything in one place&lt;/li&gt;
&lt;li&gt;Thunks help handle real-world async logic&lt;/li&gt;
&lt;li&gt;React Router is more than just navigation&lt;/li&gt;
&lt;li&gt;Route-based data fetching improves architecture&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This week wasn’t about learning more tools.&lt;/p&gt;

&lt;p&gt;It was about learning &lt;strong&gt;better ways to use them&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That’s the difference.&lt;/p&gt;

&lt;p&gt;And slowly, things are starting to connect.&lt;/p&gt;




&lt;p&gt;If you're learning React and Redux, my advice:&lt;/p&gt;

&lt;p&gt;Don’t just follow tutorials.&lt;/p&gt;

&lt;p&gt;Try to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how data flows&lt;/li&gt;
&lt;li&gt;where logic should live&lt;/li&gt;
&lt;li&gt;how to structure things properly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s where real growth happens.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I Finally Understood How to Pass Multiple Values in Redux Toolkit (The Right Way)</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Thu, 19 Mar 2026 00:47:11 +0000</pubDate>
      <link>https://dev.to/usama_dev/i-finally-understood-how-to-pass-multiple-values-in-redux-toolkit-the-right-way-21k</link>
      <guid>https://dev.to/usama_dev/i-finally-understood-how-to-pass-multiple-values-in-redux-toolkit-the-right-way-21k</guid>
      <description>&lt;p&gt;Today was one of those small learning moments…&lt;br&gt;
but it completely changed how I write Redux logic.&lt;/p&gt;

&lt;p&gt;I used to think:&lt;/p&gt;

&lt;p&gt;👉 “Redux actions can only take one value”&lt;br&gt;
👉 “If I need more data, things will get messy”&lt;/p&gt;

&lt;p&gt;But today I learned a clean and scalable way to handle &lt;strong&gt;multiple values in Redux Toolkit&lt;/strong&gt; using the &lt;code&gt;prepare&lt;/code&gt; function.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem I Faced
&lt;/h2&gt;

&lt;p&gt;I was trying to dispatch an action like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loan amount&lt;/li&gt;
&lt;li&gt;Loan purpose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first, I didn’t know how to pass both values properly.&lt;/p&gt;

&lt;p&gt;I thought maybe I need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple actions&lt;/li&gt;
&lt;li&gt;or a complex payload structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But that would make things messy and hard to maintain.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Solution: &lt;code&gt;prepare&lt;/code&gt; Function in Redux Toolkit
&lt;/h2&gt;

&lt;p&gt;Then I discovered something powerful inside &lt;code&gt;createSlice&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;👉 The &lt;code&gt;prepare&lt;/code&gt; method&lt;/p&gt;

&lt;p&gt;Here’s the code I worked with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;requestLoan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;purpose&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;purpose&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;

  &lt;span class="nf"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loan&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;loanPurpose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;purpose&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What’s Happening Here?
&lt;/h2&gt;

&lt;p&gt;This is what I understood:&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ &lt;code&gt;prepare&lt;/code&gt; Handles Multiple Arguments
&lt;/h3&gt;

&lt;p&gt;Instead of passing one object manually, I can do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;requestLoan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Buy Car&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And &lt;code&gt;prepare&lt;/code&gt; converts it into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;purpose&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Buy Car&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean. Structured. Scalable.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ Reducer Stays Simple
&lt;/h3&gt;

&lt;p&gt;Inside the reducer, I don’t worry about arguments anymore.&lt;/p&gt;

&lt;p&gt;I just use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;action.payload.amount&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;action.payload.purpose&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is already organized.&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣ Logic Feels More Professional
&lt;/h3&gt;

&lt;p&gt;This approach helped me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avoid messy payload creation in components&lt;/li&gt;
&lt;li&gt;keep logic centralized&lt;/li&gt;
&lt;li&gt;write cleaner and more readable reducers&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;Before this, I was thinking in a limited way.&lt;/p&gt;

&lt;p&gt;Now I understand:&lt;/p&gt;

&lt;p&gt;👉 Redux Toolkit is designed to &lt;strong&gt;simplify complex patterns&lt;/strong&gt;&lt;br&gt;
👉 You don’t need hacks — just the right tools&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;prepare&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;makes actions flexible&lt;/li&gt;
&lt;li&gt;keeps reducers clean&lt;/li&gt;
&lt;li&gt;improves scalability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Today I learned:&lt;/p&gt;

&lt;p&gt;You don’t need multiple actions for multiple values.&lt;/p&gt;

&lt;p&gt;You just need a &lt;strong&gt;better way to structure your payload&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;prepare&lt;/code&gt; gives you exactly that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This wasn’t a big feature.&lt;/p&gt;

&lt;p&gt;But it was a &lt;strong&gt;big mindset shift&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Redux Toolkit is not just about writing less code…&lt;/p&gt;

&lt;p&gt;It’s about writing &lt;strong&gt;smarter and cleaner code&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;If you're learning Redux Toolkit, don’t ignore small features like this.&lt;/p&gt;

&lt;p&gt;Sometimes, these small things make the biggest difference.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>why start i use redux toolkit? why not classic redux?</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Tue, 17 Mar 2026 17:32:56 +0000</pubDate>
      <link>https://dev.to/usama_dev/why-start-i-use-redux-toolkit-why-not-classic-redux-2cji</link>
      <guid>https://dev.to/usama_dev/why-start-i-use-redux-toolkit-why-not-classic-redux-2cji</guid>
      <description>&lt;p&gt;I Was Writing 4 Redux Functions for Everything… Until Redux Toolkit Changed It&lt;/p&gt;

&lt;p&gt;When I first started learning Redux, I thought this was just how things worked.&lt;/p&gt;

&lt;p&gt;If I needed to manage a simple feature, I had to write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action types&lt;/li&gt;
&lt;li&gt;Action creators&lt;/li&gt;
&lt;li&gt;Reducers&lt;/li&gt;
&lt;li&gt;Store configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first, it felt “professional”.&lt;/p&gt;

&lt;p&gt;But after a few days, it started to feel… repetitive.&lt;/p&gt;

&lt;p&gt;And honestly, a bit exhausting.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With Classic Redux (From My Experience)
&lt;/h2&gt;

&lt;p&gt;Let me be real.&lt;/p&gt;

&lt;p&gt;Redux is powerful. No doubt.&lt;/p&gt;

&lt;p&gt;But as a beginner, I kept asking myself:&lt;/p&gt;

&lt;p&gt;Why do I need &lt;strong&gt;so much code&lt;/strong&gt; just to update a simple state?&lt;/p&gt;

&lt;p&gt;For one feature, I was jumping between multiple files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;actions.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;reducers.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.js&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And inside those files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;writing constants&lt;/li&gt;
&lt;li&gt;writing functions&lt;/li&gt;
&lt;li&gt;writing switch cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It felt like I was doing the same thing again and again.&lt;/p&gt;




&lt;h2&gt;
  
  
  Then I Discovered Redux Toolkit
&lt;/h2&gt;

&lt;p&gt;Today, I finally spent time understanding &lt;strong&gt;Redux Toolkit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And this is where everything started to change.&lt;/p&gt;

&lt;p&gt;Redux Toolkit is basically the &lt;strong&gt;modern way of writing Redux&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It removes the unnecessary complexity and keeps the power.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Moment That Changed Everything
&lt;/h2&gt;

&lt;p&gt;There were two functions that completely changed my understanding:&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ &lt;code&gt;configureStore&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;I had to manually use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;createStore&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;combineReducers&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;applyMiddleware&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;Just one function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;configureStore&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;rootReducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;Everything is handled internally.&lt;/p&gt;

&lt;p&gt;No extra setup.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ &lt;code&gt;createSlice&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This one honestly surprised me.&lt;/p&gt;

&lt;p&gt;Before, I had to write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;action types&lt;/li&gt;
&lt;li&gt;action creators&lt;/li&gt;
&lt;li&gt;reducers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Separately.&lt;/p&gt;

&lt;p&gt;Now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;counterSlice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createSlice&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;initialState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;reducers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just like that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;actions are created automatically&lt;/li&gt;
&lt;li&gt;reducer is created automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One function replaces &lt;strong&gt;3–4 things&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Best Part: Cleaner Code
&lt;/h2&gt;

&lt;p&gt;What I really liked is how clean everything feels now.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No switch statements&lt;/li&gt;
&lt;li&gt;No scattered files&lt;/li&gt;
&lt;li&gt;No repeated boilerplate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything lives in one place.&lt;/p&gt;

&lt;p&gt;And for the first time, Redux felt… simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Small But Important Realization
&lt;/h2&gt;

&lt;p&gt;Another thing I learned today:&lt;/p&gt;

&lt;p&gt;You don’t have to switch everything at once.&lt;/p&gt;

&lt;p&gt;You can use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;classic Redux&lt;/li&gt;
&lt;li&gt;Redux Toolkit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;in the same project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And both connect to React in the same way.&lt;/p&gt;

&lt;p&gt;That means you can &lt;strong&gt;migrate step by step&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;No pressure.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned Today
&lt;/h2&gt;

&lt;p&gt;Today wasn’t about building something big.&lt;/p&gt;

&lt;p&gt;It was about understanding:&lt;/p&gt;

&lt;p&gt;How to write &lt;strong&gt;better Redux code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;How to reduce unnecessary complexity.&lt;/p&gt;

&lt;p&gt;How to focus more on logic instead of boilerplate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Before today, Redux felt like a lot of work.&lt;/p&gt;

&lt;p&gt;After understanding Redux Toolkit, it finally started to feel practical.&lt;/p&gt;

&lt;p&gt;If you’re learning Redux right now, my honest advice:&lt;/p&gt;

&lt;p&gt;Don’t just learn classic Redux.&lt;/p&gt;

&lt;p&gt;Learn &lt;strong&gt;Redux Toolkit early&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It will save you time, energy, and a lot of confusion.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Week 23: I Finally Went Deep Into Redux (And It Started Making Sense)</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Tue, 17 Mar 2026 17:24:02 +0000</pubDate>
      <link>https://dev.to/usama_dev/week-23-i-finally-went-deep-into-redux-and-it-started-making-sense-4o5o</link>
      <guid>https://dev.to/usama_dev/week-23-i-finally-went-deep-into-redux-and-it-started-making-sense-4o5o</guid>
      <description>&lt;p&gt;This week was intense.&lt;/p&gt;

&lt;p&gt;Not because Redux is impossible…&lt;br&gt;
But because I finally stopped just “using” it — and started &lt;strong&gt;understanding how it actually works under the hood&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that changed everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  From Confusion to Clarity
&lt;/h2&gt;

&lt;p&gt;Before this week, Redux felt like a set of rules I had to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dispatch this&lt;/li&gt;
&lt;li&gt;Write that reducer&lt;/li&gt;
&lt;li&gt;Create actions&lt;/li&gt;
&lt;li&gt;Connect everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It worked… but I didn’t fully &lt;em&gt;get it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This week, I decided to go deeper.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding the Redux Store (The Brain)
&lt;/h2&gt;

&lt;p&gt;The biggest realization:&lt;/p&gt;

&lt;p&gt;Redux Store is not just storage.&lt;/p&gt;

&lt;p&gt;It’s the &lt;strong&gt;single source of truth&lt;/strong&gt; for the entire application.&lt;/p&gt;

&lt;p&gt;Everything flows through it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State lives here&lt;/li&gt;
&lt;li&gt;Actions go here&lt;/li&gt;
&lt;li&gt;Reducers update it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once I understood this flow, Redux stopped feeling random.&lt;/p&gt;

&lt;p&gt;It started feeling &lt;strong&gt;predictable&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Action Creator Functions (Not Just Functions)
&lt;/h2&gt;

&lt;p&gt;Earlier, I used to think action creators were just “extra functions”.&lt;/p&gt;

&lt;p&gt;But now I understand their real purpose:&lt;/p&gt;

&lt;p&gt;They make actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reusable&lt;/li&gt;
&lt;li&gt;consistent&lt;/li&gt;
&lt;li&gt;easier to manage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of manually creating objects every time, action creators standardize everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Redux File Structure (Why It Matters)
&lt;/h2&gt;

&lt;p&gt;This week I also explored proper file structure.&lt;/p&gt;

&lt;p&gt;Before, my files were scattered.&lt;/p&gt;

&lt;p&gt;Now I understand why developers organize Redux like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;store.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;features/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;separate slices or reducers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good structure is not about “clean folders”.&lt;/p&gt;

&lt;p&gt;It’s about &lt;strong&gt;scalability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because when your app grows, bad structure becomes a real problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Dispatching (The Trigger Point)
&lt;/h2&gt;

&lt;p&gt;Dispatch finally clicked for me.&lt;/p&gt;

&lt;p&gt;It’s not just a function.&lt;/p&gt;

&lt;p&gt;It’s the &lt;strong&gt;only way to change state&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;p&gt;No direct updates.&lt;br&gt;
No shortcuts.&lt;/p&gt;

&lt;p&gt;Everything must go through dispatch.&lt;/p&gt;

&lt;p&gt;And that’s what makes Redux predictable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Redux Middleware (The Hidden Power)
&lt;/h2&gt;

&lt;p&gt;This was one of the most interesting parts of the week.&lt;/p&gt;

&lt;p&gt;Middleware sits between:&lt;/p&gt;

&lt;p&gt;👉 Action → Reducer&lt;/p&gt;

&lt;p&gt;And it can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;log actions&lt;/li&gt;
&lt;li&gt;handle async logic&lt;/li&gt;
&lt;li&gt;modify behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s like a &lt;strong&gt;gatekeeper&lt;/strong&gt; for your state flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Thunks (Handling Async Like a Pro)
&lt;/h2&gt;

&lt;p&gt;Before learning thunks, I didn’t fully understand how Redux handles async code.&lt;/p&gt;

&lt;p&gt;Now I do.&lt;/p&gt;

&lt;p&gt;Thunks allow us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;write async logic&lt;/li&gt;
&lt;li&gt;delay dispatching&lt;/li&gt;
&lt;li&gt;handle API calls&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where Redux becomes truly powerful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Making API Calls with Redux
&lt;/h2&gt;

&lt;p&gt;This was a big step.&lt;/p&gt;

&lt;p&gt;Instead of calling APIs directly in components, I learned to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;move logic into Redux&lt;/li&gt;
&lt;li&gt;handle loading states&lt;/li&gt;
&lt;li&gt;manage success and errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now the data flow feels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cleaner&lt;/li&gt;
&lt;li&gt;centralized&lt;/li&gt;
&lt;li&gt;easier to debug&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Redux DevTools (Game Changer)
&lt;/h2&gt;

&lt;p&gt;If there is one tool that made the biggest difference this week, it’s Redux DevTools.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;Debugging felt messy.&lt;/p&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;p&gt;I can see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every action&lt;/li&gt;
&lt;li&gt;every state change&lt;/li&gt;
&lt;li&gt;full history of my app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the best part?&lt;/p&gt;

&lt;p&gt;👉 Time-travel debugging&lt;/p&gt;

&lt;p&gt;I can literally go back and see where things broke.&lt;/p&gt;

&lt;p&gt;That’s insane.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Changed for Me This Week
&lt;/h2&gt;

&lt;p&gt;Before Week 23:&lt;/p&gt;

&lt;p&gt;Redux felt complicated.&lt;/p&gt;

&lt;p&gt;After Week 23:&lt;/p&gt;

&lt;p&gt;Redux feels &lt;strong&gt;structured and logical&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I won’t say it’s “easy” yet.&lt;/p&gt;

&lt;p&gt;But now I understand:&lt;/p&gt;

&lt;p&gt;👉 Why things are done&lt;br&gt;
👉 Not just how they are done&lt;/p&gt;

&lt;p&gt;And that’s a big shift.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This week wasn’t about building fancy UI.&lt;/p&gt;

&lt;p&gt;It was about building &lt;strong&gt;mental clarity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how data flows&lt;/li&gt;
&lt;li&gt;how state is managed&lt;/li&gt;
&lt;li&gt;how real applications scale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Redux is not just a library.&lt;/p&gt;

&lt;p&gt;It’s a way of thinking.&lt;/p&gt;

&lt;p&gt;And this week, I finally started thinking like it.&lt;/p&gt;




&lt;p&gt;If you’re learning Redux, don’t rush.&lt;/p&gt;

&lt;p&gt;Take time to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store&lt;/li&gt;
&lt;li&gt;Dispatch&lt;/li&gt;
&lt;li&gt;Middleware&lt;/li&gt;
&lt;li&gt;Async flow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because once it clicks…&lt;/p&gt;

&lt;p&gt;Everything starts making sense.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Thought Redux DevTools Was Just a Fancy Logger — Until I Actually Used It</title>
      <dc:creator>Usama</dc:creator>
      <pubDate>Sun, 15 Mar 2026 11:53:25 +0000</pubDate>
      <link>https://dev.to/usama_dev/i-thought-redux-devtools-was-just-a-fancy-logger-until-i-actually-used-it-2a68</link>
      <guid>https://dev.to/usama_dev/i-thought-redux-devtools-was-just-a-fancy-logger-until-i-actually-used-it-2a68</guid>
      <description>&lt;p&gt;When I first started learning Redux, I thought &lt;strong&gt;Redux DevTools was just another debugging tool&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You know… something like &lt;code&gt;console.log()&lt;/code&gt; but with a better UI.&lt;/p&gt;

&lt;p&gt;But when I actually started building real features, I realized something surprising:&lt;/p&gt;

&lt;p&gt;Redux DevTools is not just a debugger.&lt;br&gt;
It is a &lt;strong&gt;complete timeline of your application's brain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And once you understand that, debugging Redux becomes &lt;strong&gt;10x easier&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem I Faced While Learning Redux
&lt;/h2&gt;

&lt;p&gt;While building a feature in my React project, I had a simple flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User clicks a button&lt;/li&gt;
&lt;li&gt;An action dispatches&lt;/li&gt;
&lt;li&gt;The reducer updates the state&lt;/li&gt;
&lt;li&gt;UI re-renders&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simple right?&lt;/p&gt;

&lt;p&gt;But something weird happened.&lt;/p&gt;

&lt;p&gt;The UI was not updating the way I expected.&lt;/p&gt;

&lt;p&gt;At first I tried:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;console.log(action)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;console.log(state)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;checking reducers manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But after a few actions, the logs became messy.&lt;/p&gt;

&lt;p&gt;I couldn't clearly understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which action triggered the bug&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;previous state&lt;/strong&gt; was&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;next state&lt;/strong&gt; became&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is where Redux DevTools completely changed the debugging experience.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Redux DevTools Actually Does
&lt;/h2&gt;

&lt;p&gt;Redux DevTools is a browser extension that lets developers &lt;strong&gt;inspect every action and state change in a Redux application&lt;/strong&gt;. ([Artoon Solutions][1])&lt;/p&gt;

&lt;p&gt;Instead of guessing what happened in your application, you can literally &lt;strong&gt;see the entire state timeline&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of it like a &lt;strong&gt;recording of everything that happened in your Redux store&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Feature That Blew My Mind: Time Travel Debugging
&lt;/h2&gt;

&lt;p&gt;This was the moment I realized why Redux DevTools is powerful.&lt;/p&gt;

&lt;p&gt;Redux DevTools allows something called &lt;strong&gt;time-travel debugging&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Meaning:&lt;/p&gt;

&lt;p&gt;You can move backward and forward through your application's state history. ([Colin.js][2])&lt;/p&gt;

&lt;p&gt;Yes… literally.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Action 1 → LOGIN_USER
Action 2 → ADD_ITEM
Action 3 → REMOVE_ITEM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can click any action and Redux DevTools will show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Previous State&lt;/li&gt;
&lt;li&gt;Action Payload&lt;/li&gt;
&lt;li&gt;Next State&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means you can instantly see &lt;strong&gt;which action broke your app&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;No guessing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real Example: Debugging a Cart Bug
&lt;/h2&gt;

&lt;p&gt;Imagine you're building an &lt;strong&gt;e-commerce cart&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A user adds a product and the quantity becomes wrong.&lt;/p&gt;

&lt;p&gt;Without Redux DevTools:&lt;/p&gt;

&lt;p&gt;You would probably add logs everywhere.&lt;/p&gt;

&lt;p&gt;With Redux DevTools:&lt;/p&gt;

&lt;p&gt;You just open the DevTools and see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;ADD_PRODUCT&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;previousState:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;cart:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;nextState:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;cart:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;id:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;quantity:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom.&lt;/p&gt;

&lt;p&gt;Now you instantly know the reducer logic is wrong.&lt;/p&gt;

&lt;p&gt;This is why many teams use DevTools to &lt;strong&gt;trace bugs in complex applications&lt;/strong&gt;. ([pixeeto.com][3])&lt;/p&gt;




&lt;h2&gt;
  
  
  My Favorite Redux DevTools Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Action History
&lt;/h3&gt;

&lt;p&gt;Every action is recorded.&lt;/p&gt;

&lt;p&gt;You can see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;action type&lt;/li&gt;
&lt;li&gt;payload&lt;/li&gt;
&lt;li&gt;timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps you understand &lt;strong&gt;exactly what triggered a state change&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ State Tree Inspector
&lt;/h3&gt;

&lt;p&gt;You can inspect the &lt;strong&gt;entire Redux store&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Nested objects, arrays, everything.&lt;/p&gt;

&lt;p&gt;No more &lt;code&gt;console.log(state)&lt;/code&gt; everywhere.&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣ Action Replay
&lt;/h3&gt;

&lt;p&gt;You can replay actions.&lt;/p&gt;

&lt;p&gt;Meaning you can reproduce bugs without manually repeating user steps.&lt;/p&gt;

&lt;p&gt;This is extremely useful when debugging.&lt;/p&gt;




&lt;h3&gt;
  
  
  4️⃣ Import / Export State
&lt;/h3&gt;

&lt;p&gt;You can export the state snapshot and send it to another developer.&lt;/p&gt;

&lt;p&gt;They can load it and reproduce the exact bug scenario.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Biggest Lesson I Learned
&lt;/h2&gt;

&lt;p&gt;Before Redux DevTools:&lt;/p&gt;

&lt;p&gt;Debugging Redux felt confusing.&lt;/p&gt;

&lt;p&gt;After Redux DevTools:&lt;/p&gt;

&lt;p&gt;Redux actually became &lt;strong&gt;one of the easiest things to debug&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because everything is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;predictable&lt;/li&gt;
&lt;li&gt;visible&lt;/li&gt;
&lt;li&gt;traceable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Redux forces your application to follow a clear data flow.&lt;/p&gt;

&lt;p&gt;And DevTools lets you &lt;strong&gt;watch that flow step by step&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  One Important Tip
&lt;/h2&gt;

&lt;p&gt;Never enable Redux DevTools in production.&lt;/p&gt;

&lt;p&gt;Because it exposes the entire state of your application.&lt;/p&gt;

&lt;p&gt;Use it only in development mode.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;At first, Redux DevTools looked like just another extension.&lt;/p&gt;

&lt;p&gt;But once I started using it during real debugging, I realized something:&lt;/p&gt;

&lt;p&gt;It’s not just a tool.&lt;/p&gt;

&lt;p&gt;It’s like having &lt;strong&gt;X-ray vision into your application's state&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And once you get used to it, debugging Redux without DevTools feels almost impossible.&lt;/p&gt;




&lt;p&gt;If you're learning Redux right now, my advice is simple:&lt;/p&gt;

&lt;p&gt;Don't just install Redux DevTools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actually learn how to read the action timeline.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because that's where Redux truly starts making sense.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
