<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by max7up on Medium]]></title>
        <description><![CDATA[Stories by max7up on Medium]]></description>
        <link>https://medium.com/@max7up?source=rss-22b6429256ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*teuY4mhOLJkpOmpadDoF_A.gif</url>
            <title>Stories by max7up on Medium</title>
            <link>https://medium.com/@max7up?source=rss-22b6429256ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:59:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@max7up/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[⚛️ React in 2025: It’s Complicated, But I’m Still in Love]]></title>
            <link>https://medium.com/@max7up/%EF%B8%8F-react-in-2025-its-complicated-but-i-m-still-in-love-7a025ab6ddb1?source=rss-22b6429256ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a025ab6ddb1</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[max7up]]></dc:creator>
            <pubDate>Wed, 09 Jul 2025 21:18:57 GMT</pubDate>
            <atom:updated>2025-07-09T21:19:23.057Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*kkEYZV8TCIikie2r.png" /></figure><p>You ever been in a long-term relationship where your partner changes just enough to keep you interested, but not enough to avoid confusing you every six months?</p><p>Hi. I’m a React developer in 2025.</p><h3>🧠 “It’s Not a Framework” — React, Still Lying</h3><p>We’ve all heard it for years:</p><blockquote><em>“React is just a library.”</em></blockquote><p>Sure, and I’m just a little tired.<br>React in 2025 comes with file-based routing, server rendering, streaming, and a full-blown philosophy degree — and that’s just on a Tuesday.</p><p>Let’s talk about what this lovable chaos engine looks like now.</p><h3>💥 Server Components — Yeah, They’re Real Now</h3><p>Remember when React was all client-side? Yeah, me neither. Now we have <strong>Server Components</strong> — because who <em>wouldn’t</em> want to split their UI like a psychological thriller?</p><pre>// Server Component<br>export default async function Profile() {<br>  const user = await getUser();<br>  return &lt;h1&gt;Hello, {user.name}&lt;/h1&gt;;<br>}</pre><p><strong>Runs on the server. Ships zero JS.</strong><br>It’s fast, it’s clean, it’s… wait, why is my button broken?</p><p>Because that’s a <strong>Client Component</strong>, buddy. You didn’t mark it.<br><em>“use client” — two words that will haunt your dreams.</em></p><h3>⏳ Suspense: The Feature We Were All Waiting For… Again</h3><p>React teased us with Suspense in 2018.<br>In 2025, it&#39;s finally useful. You can wrap anything in it — pages, modals, your will to debug race conditions.</p><pre>&lt;Suspense fallback={&lt;Spinner /&gt;}&gt;<br>  &lt;Comments /&gt;<br>&lt;/Suspense&gt;</pre><p>Want streaming data? Use Suspense.<br>Want loading states? Suspense.<br>Want to hide the existential dread of complexity? Also Suspense.</p><h3>📁 Next.js App Router: It’s a Cult Now</h3><p>Next.js said, “Forget everything you know. Here’s a new folder called app/, and it&#39;s your entire identity now.”</p><pre>app/<br>  layout.tsx<br>  page.tsx<br>  loading.tsx<br>  error.tsx</pre><p>Want to show a spinner? Create a file.<br>Error boundary? Create a file.<br>Need therapy? You guessed it — create a file.</p><p>But real talk: once you get it, it’s powerful. It’s like IKEA furniture — confusing at first, but elegant once built… and maybe missing a few screws.</p><h3>🧨 useEffect? We Don’t Do That Here</h3><p>If you’re still writing this:</p><pre>useEffect(() =&gt; {<br>  fetch(&#39;/api/data&#39;).then(setData);<br>}, []);</pre><p>…then I have news for you.<br><strong>You’re living in 2022, wearing skinny jeans and listening to Spotify without AI recommendations.</strong></p><p>React in 2025 wants you to fetch data on the server, or better yet — use the mysterious use() function that looks illegal but somehow works.</p><pre>const posts = use(fetchPosts());</pre><p>Magical. Dangerous. Definitely cursed. We love it.</p><h3>🧪 Signals: React’s Answer to Midlife Crisis</h3><p>So every framework has signals now. Solid. Qwik. Vue. Even my microwave.<br>React said, “Wait for me!” and brought <strong>useSignal()</strong> to the experimental branch.</p><pre>const count = useSignal(0);<br>return &lt;button onClick={() =&gt; count.value++}&gt;{count.value}&lt;/button&gt;;</pre><p>It’s fast. It’s reactive. It makes useState() look like a fossil.<br>Only problem? It’s still in React’s <strong>Canary</strong> version, which is developer-speak for “don’t you dare use this in production unless you hate joy.”</p><h3>🛠️ Redux? Sweetie, No.</h3><p>Using Redux in 2025 is like showing up to a hackathon in a top hat and monocle.<br>We love the legacy. But now, we’ve got:</p><ul><li><strong>Zustand</strong> for global state that’s actually fun</li><li><strong>TanStack Query</strong> for fetching/caching like a boss</li><li><strong>Context + useReducer</strong>, because simplicity is sexy again</li></ul><p>Redux is still there — like a fax machine in your office. Mostly ignored. Used only in emergencies.</p><h3>🎨 Animation Is Legal Again</h3><p>React + Framer Motion in 2025 is <em>chef’s kiss</em>.<br>We animate <strong>routes</strong>, <strong>layout shifts</strong>, <strong>modals</strong>, and sometimes our feelings.</p><pre>&lt;motion.div<br>  initial={{ opacity: 0 }}<br>  animate={{ opacity: 1 }}<br>  exit={{ opacity: 0 }}<br>/&gt;</pre><p>Animation is no longer “just for Dribbble shots.”<br>It’s how you <strong>guide users</strong>, <strong>tell stories</strong>, and <strong>hide loading states while your API cries softly in the background</strong>.</p><h3>🧠 DX in 2025: Dev Experience or Developer eXistentialism?</h3><p>The tooling is faster, the builds are blazing, the types are screaming — and yet here we are asking:</p><blockquote><em>“Why does my Client Component not render inside my Server Component that’s inside my layout that’s inside another Suspense boundary?”</em></blockquote><p>Because React in 2025 is <strong>powerful but complex</strong>. It’s like dating someone super hot — you’re obsessed, but constantly questioning your own sanity.</p><h3>🔮 What’s Next?</h3><ul><li>Signals baked into core</li><li>Streaming mutations</li><li>AI-generated forms (yes, this is a thing)</li><li>More built-in animation support</li><li>Less JavaScript on the client</li><li>And hopefully… less crying in the debugger</li></ul><h3>🧵 TL;DR</h3><p>React in 2025 is:</p><p>✅ Server-first<br>✅ Async by default<br>✅ Streaming-ready<br>✅ TypeScript-native<br>✅ Still pretending to be “just a library”</p><p>React didn’t slow down — it <em>shifted</em>.<br>And if you’re still writing useEffect() to fetch data... it’s time for a React-vention.</p><p>What’s your current React pain point or win?<br>Drop your stories, war wounds, or memes below 👇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a025ab6ddb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How to Ensure Pixel-Perfect UI in React Apps]]></title>
            <link>https://medium.com/@max7up/how-to-ensure-pixel-perfect-ui-in-react-apps-ac9696376aba?source=rss-22b6429256ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9696376aba</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[pixel-perfect]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[max7up]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 21:42:19 GMT</pubDate>
            <atom:updated>2025-07-01T21:44:58.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r8m_OqnQH_T6oO4p" /></figure><blockquote>“It looks good, but not exactly like the design…”</blockquote><p>If you’ve ever heard this in a design review, you know how painful it is to chase those final few pixels.</p><p>In the world of React apps, ensuring your UI aligns <em>perfectly</em> with design mockups can be tricky. Responsive behavior, dynamic data, different screen resolutions — they all introduce tiny gaps between what you built and what was designed.</p><p>In this post, I’ll walk you through <strong>how to consistently achieve pixel-perfect UI in React</strong>, using practical methods, automation, and my favorite tools — including one that changed how I QA my UI forever.</p><h3>🧱 1. Start With a Solid Foundation</h3><p>Pixel-perfect UI starts long before you press ⌘S in your IDE. It begins with how your team structures the <strong>design-to-code pipeline</strong>.</p><h3>Use Design Tokens</h3><p>Design tokens help translate Figma or Sketch styles into actual code. Tools like <strong>Style Dictionary</strong>, <strong>Tailwind</strong>, or your own theme.js can store:</p><ul><li>font sizes</li><li>spacing</li><li>breakpoints</li><li>colors</li><li>radi</li></ul><p>This keeps your values consistent and makes updates global.</p><blockquote>Pro tip:<em> Ask your designer for their Figma token values or export them using tools like </em><a href="https://github.com/six7/figma-tokens"><em>Figma Tokens</em></a><em>.</em></blockquote><h3>🧩 2. Visually Compare Your UI to the Mockup</h3><p>You can’t fix what you can’t see. Instead of relying on your eyes alone, use a <strong>visual overlay tool</strong> to compare your live app to the design.</p><h3>My Favorite: Pixel Perfect Pro (Chrome Extension)</h3><p><a href="https://pixelperfectpro.online/">Pixel Perfect Pro</a> lets you drop a screenshot of the design directly over your live site. Then you can:</p><ul><li>move, scale, and align the overlay</li><li>lock its position</li><li>adjust opacity to see through</li></ul><p>It works <em>especially well</em> when reviewing spacing, fonts, margins, or pixel shifts on dynamic components.</p><p><em>Image: overlaying a mockup directly onto a live React app</em></p><h3>⚙️ 3. Automate With Visual Regression Testing</h3><p>Manual review is time-consuming and error-prone. Let automation flag visual changes so you can catch UI drift early.</p><h3>Top Tools for Visual Regression:</h3><ul><li><strong>Chromatic</strong> — for Storybook-based UI testing</li><li><strong>Percy</strong> — great CI integration</li><li><strong>Applitools</strong> — smart AI-based visual testing</li><li><strong>Loki</strong> — integrates directly with your React stories</li></ul><blockquote><em>These tools take screenshots of your components or pages and highlight any visual differences after a code change. Magic.</em></blockquote><h3>📚 4. Use Storybook (Seriously)</h3><p>If you’re not using <a href="https://storybook.js.org/">Storybook</a> for UI development, now is the time. It isolates your components from the app, which means:</p><ul><li>easier testing</li><li>visual review of variants and states</li><li>faster feedback from designers</li></ul><p>And when combined with tools like Chromatic, it becomes your best weapon for <strong>maintaining visual consistency</strong>.</p><h3>🧪 5. Debug With DevTools Like a Pro</h3><p>Sometimes all you need is a ruler and a keen eye.</p><p>In Chrome DevTools:</p><ul><li>Use the <strong>“Computed” tab</strong> to view spacing and box-model in one glance</li><li>Use <strong>:hover, </strong><strong>:focus, or </strong><strong>:active</strong> toggles to inspect state-specific styles</li><li>Add this snippet temporarily for layout debugging:</li></ul><pre>* {<br>  outline: 1px solid rgba(255, 0, 0, 0.3);<br>}</pre><blockquote><em>Trust me, this little outline trick will save you hours.</em></blockquote><h3>🤖 6. Know the Common Pitfalls</h3><p>Here are common issues that can silently ruin pixel perfection:</p><ul><li>box-sizing: content-box instead of border-box</li><li>inconsistent rem/px usage</li><li>3rd party component styles leaking in</li><li>hardcoded “magic numbers” instead of spacing tokens</li><li>small font rendering differences between OS/browser</li></ul><p>Stay aware of these, especially when debugging that <em>one stubborn misalignment</em>.</p><h3>🔚 Final Thoughts</h3><p>Pixel-perfect UI isn’t about obsessing over every line of CSS. It’s about having a system in place that helps you:</p><ul><li>code with consistent design rules</li><li>visually compare UI and designs</li><li>automate testing and feedback</li><li>debug quickly when things go off</li></ul><p>By combining component-driven dev, visual tools like <strong>Pixel Perfect Pro</strong>, and automated regression testing, you’ll deliver UI that not only <em>works</em> — it <em>looks exactly right.</em></p><h3>👇 Try It Out</h3><p>If you’re tired of squinting at your screen wondering “Is this 8px or 10px?”, give <a href="https://pixelperfectpro.online/">Pixel Perfect Pro</a> a try. It’s lightweight, fast, and made for devs like us.</p><p>💬 Have a favorite trick or tool for pixel-perfect dev? Drop it in the comments! I’d love to hear what works for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9696376aba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Custom Hooks — Part #1. Less lines of code and more functionality with useAsyncState]]></title>
            <link>https://medium.com/@max7up/react-custom-hooks-part-1-less-lines-of-code-and-more-functionality-with-useasyncstate-7c4f691f6e75?source=rss-22b6429256ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c4f691f6e75</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[dry]]></category>
            <category><![CDATA[hooks]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[max7up]]></dc:creator>
            <pubDate>Sun, 12 May 2024 13:59:02 GMT</pubDate>
            <atom:updated>2024-05-12T13:59:02.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>React Custom Hooks — Part #1. Less lines of code and more functionality with useAsyncState</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSgIutEScrDWn425nQ6Nxw.jpeg" /></figure><p>A common use case in React apps is to perform a data mutation and then update state in response. For example, when a user submits a form to change their name, you will make an API request, and then handle the response. In the past, you would need to handle pending states, errors and sequential requests manually.</p><p>For example, you could handle the pending and error state in useState:</p><pre>import React, {useState} from &#39;react&#39;<br><br>// Before<br>function UpdateName() {<br>  const [name, setName] = useState(&quot;&quot;);<br>  const [error, setError] = useState(null);<br>  const [isPending, setIsPending] = useState(false);<br><br>  const handleSubmit = async () =&gt; {<br>    setIsPending(true);<br><br>    try {<br>      await updateName(name);<br><br>      redirect(&quot;/path&quot;);<br>    } catch(error) {<br>      setError(error);<br>    } finally {<br>      setIsPending(false);<br>    }<br>  };<br><br>  return (<br>    &lt;div&gt;<br>      &lt;input value={name} onChange={(event) =&gt; setName(event.target.value)} /&gt;<br>      &lt;button onClick={handleSubmit} disabled={isPending}&gt;<br>        Update<br>      &lt;/button&gt;<br>      {error &amp;&amp; &lt;p&gt;{error}&lt;/p&gt;}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>This is a common code that usually React developers see in a project. But we can simplify this logic with a custom hook.</p><p>Now, let’s imagine that we have a useAsyncAction hook that includes loading and error tracking features under the hood – it can look like this.</p><pre>import React, {useState} from &#39;react&#39;<br><br>// After<br>function UpdateName() {<br>  const [name, setName] = useState(&quot;&quot;);<br><br>  const [{isPending, error}, handleSubmit] = useAsyncAction(async () =&gt; {<br>       await updateName(name); // example of request function to update name<br>       redirect(&quot;/path&quot;); // example function to redirect <br>  }, [name])<br><br>  return (<br>    &lt;div&gt;<br>      &lt;input value={name} onChange={(event) =&gt; setName(event.target.value)} /&gt;<br>      &lt;button onClick={handleSubmit} disabled={isPending}&gt;<br>        Update<br>      &lt;/button&gt;<br>      {error &amp;&amp; &lt;p&gt;{error}&lt;/p&gt;}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Now, the code to submit input is more compact and readable.</p><p>This is a demonstration of how we can solve any task with fewer lines of code.</p><p>An important thing to keep in mind is that we should adhere to the <em>‘Don’t Repeat Yourself’ (DRY)</em> principle, even if it takes a couple of extra lines.</p><p><em>Code of a custom hook:</em></p><pre>  import React, {useState, useCallback} from &#39;react&#39;<br><br>  const useAsyncAction = (callback, dependencies) =&gt; {<br>    const [error, setError] = useState(null);<br>    const [isPending, setIsPending] = useState(false);<br><br>    const wrappedCallback = useCallback(async () =&gt; {<br>      try {<br>        return await callback();<br>      } catch(error) {<br>        setError(error);<br>        return Promise.reject(error);<br>      } finally {<br>        setIsPending(false);<br>      }<br>    }, [...dependencies]);<br><br>   <br>    return [{error, isPending}, wrappedCallback]<br>  }<br><br></pre><p>If you have any comments, suggestions, or questions, feel free to share them in the comments 😁.</p><p><em>And don’t forget to keep your code clean!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c4f691f6e75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS: Stop using switch…case]]></title>
            <link>https://medium.com/@max7up/js-stop-using-switch-case-9db76dabbb1e?source=rss-22b6429256ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/9db76dabbb1e</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[max7up]]></dc:creator>
            <pubDate>Fri, 03 May 2024 21:45:17 GMT</pubDate>
            <atom:updated>2024-05-03T21:45:17.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*ogk-7MOaGPMuzCA8c9Xe4g.jpeg" /></figure><p>So many times, I review code from developers and often encounter a common problem: the code isn’t clear and simple enough.</p><p>Therefore, I’ve decided to write this short post to address at least one issue for developers, whether they are new or experienced. Let’s start with a problem that frequently arises in code: the <strong>switch…case</strong> statement.</p><p>Here is a classic example of a <strong>switch…case</strong> code.</p><pre>let fruit = &quot;Apple&quot;;<br><br>switch (fruit) {<br>  case &quot;Banana&quot;:<br>    console.log(&quot;Banana is yellow.&quot;);<br>    break;<br>  case &quot;Apple&quot;:<br>    console.log(&quot;Apple is red.&quot;);<br>    break;<br>  case &quot;Orange&quot;:<br>    console.log(&quot;Orange is orange.&quot;);<br>    break;<br>  default:<br>    console.log(&quot;Unknown fruit.&quot;);<br>}</pre><p>And there are next issues that I found:</p><ol><li>It’s easy to forget to write the <strong>break</strong> keyword, which can lead to the code executing differently. In such cases, the outcome may depend on the previous <strong>case</strong> 😭.</li><li>When dealing with large constructions and many lines of code, you have to keep it all in your mind while reading through the code line by line. In this example, there are only about 15 lines of code, but in real development scenarios, files can be much larger and require even greater focus 🤔.</li></ol><p>Here is the next example that illustrates a refactored way to write this code</p><pre>let fruit = &quot;Apple&quot;;<br><br>const fruitMessages = {<br> Banana: &quot;Banana is yellow.&quot;,<br> Apple: &quot;Apple is red.&quot;,<br> Orange: &quot;Orange is orange.&quot;,<br>}<br><br>console.log(fruitMessages[fruit] ?? &quot;Unknown fruit.&quot;);<br></pre><p>As you can see, we fixed <strong>switch…case</strong> issues and got more readable and reusable code.</p><ol><li>It’s easy to extend the <strong>fruitMessages</strong> object, with no chance of breaking your code when adding or deleting keys and values 😌.</li><li>The construction is shorter, requiring less focus to read or change the code 😉.</li><li>This results in smaller file sizes and better code to reuse 🫡</li></ol><p>You can utilize this trick even when needing to execute dynamic blocks of code inside a <strong>switch</strong>. In such cases, you can move this code to functions and create a key-value structure that references them.</p><p>Just compare the two ways to solve the same task. And select which one is better for you.</p><pre>const action = &quot;add&quot;;<br><br>const firstInt = 1;<br>const secInt = 3;<br><br>switch (fruit) {<br>  case &quot;add&quot;:<br>    console.log(`${firstInt} + ${secInt} = ${firstInt + secInt}`);<br>    break;<br>  case &quot;minus&quot;:<br>    console.log(`${firstInt} - ${secInt} = ${firstInt - secInt}`);<br>    break;<br>  default:<br>    console.log(&quot;Unknown operation.&quot;);<br>}</pre><pre>const action = &quot;add&quot;;<br><br>const mathOperations = {<br> add: (firstInt, secInt) =&gt; `${firstInt} + ${secInt} = ${firstInt + secInt}`,<br> minus: (firstInt, secInt) =&gt; `${firstInt} - ${secInt} = ${firstInt - secInt}`,<br>}<br><br>const operation = mathOperations[action]<br><br>console.log(operation ? operation(1, 3) : &quot;Unknown operation.&quot;);</pre><p>I’ve just illustrated the difference between using <strong>switch…case</strong> and an alternative approach. Any other constructions can be altered as well.</p><p>If you have any comments, suggestions, or questions, feel free to share them in the comments 😁.</p><p>And don’t forget to keep your code clean!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9db76dabbb1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>