<?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: Stanley Azi</title>
    <description>The latest articles on DEV Community by Stanley Azi (@stan015).</description>
    <link>https://dev.to/stan015</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1600558%2F3409b5df-3467-4220-ba8e-498dc740716a.png</url>
      <title>DEV Community: Stanley Azi</title>
      <link>https://dev.to/stan015</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stan015"/>
    <language>en</language>
    <item>
      <title>The Power of git reflog: Fix Broken Git History</title>
      <dc:creator>Stanley Azi</dc:creator>
      <pubDate>Sun, 15 Jun 2025 16:16:58 +0000</pubDate>
      <link>https://dev.to/stan015/the-power-of-git-reflog-fix-broken-git-history-3pkj</link>
      <guid>https://dev.to/stan015/the-power-of-git-reflog-fix-broken-git-history-3pkj</guid>
      <description>&lt;p&gt;Ever experienced a moment when your code editor or terminal crashes and you lose the changes you’ve just made? Or a scenario where you are about to reset a Git HEAD, amend or rebase a commit, and suddenly your Git history is out of control because your editor or terminal crashed?&lt;/p&gt;

&lt;p&gt;In this article I will walk you through the power of &lt;code&gt;git reflog&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hinting at the power of Git
&lt;/h2&gt;

&lt;p&gt;Git is a tool that helps developers maintain version control and track every change in a codebase. It enables collaboration, simplifies code review, and provides a safety net when things go wrong. It is essential for every developer to know how to use Git commands effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;code&gt;git reflog&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;While &lt;code&gt;git log&lt;/code&gt; shows the history of all finalised commits in your branch, &lt;code&gt;git reflog&lt;/code&gt; records every change to &lt;code&gt;HEAD&lt;/code&gt; and branch tips, even if those commits are no longer reachable by any branch. It shows you exactly when you started a rebase or reset, which commits were applied or skipped, and when the rebase or other operations finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is &lt;code&gt;git reflog&lt;/code&gt; helpful?
&lt;/h2&gt;

&lt;p&gt;Take a look at the screenshot below of a &lt;code&gt;git rebase&lt;/code&gt;. You can see the start of the rebase, each step where a commit was picked, and the finish when the operation completed, all labeled by entries like &lt;code&gt;HEAD@{15}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2grv9s8a1oqqv76skkuy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2grv9s8a1oqqv76skkuy.png" alt="git reflog" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git reflog&lt;/code&gt; becomes extremely useful because it lets you checkout any of those &lt;code&gt;HEAD&lt;/code&gt; states and recover your code exactly as it was before a crash or unintended change. You can jump back to where you need to be, even if the commit is no longer part of your visible history.&lt;/p&gt;

&lt;h2&gt;
  
  
  When do you need &lt;code&gt;git reflog&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Here is a real example from my own experience:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I made a commit, then realized I needed to adjust part of it.&lt;/li&gt;
&lt;li&gt;I ran &lt;code&gt;git reset --soft HEAD^&lt;/code&gt; to go back and make those changes.&lt;/li&gt;
&lt;li&gt;In the middle of editing, my code editor froze. When I restarted, I discovered a rebase had started on another branch without my input.&lt;/li&gt;
&lt;li&gt;I aborted the rebase, but lost the uncommitted changes I was working on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At this point I ran &lt;code&gt;git reflog&lt;/code&gt; and saw the exact entries for the rebase start and finish. I found the &lt;code&gt;HEAD&lt;/code&gt; state just before the rebase began (even though it had the same commit hash) and reset back to it. Thanks to &lt;code&gt;git reflog&lt;/code&gt;, I recovered all my changes without losing a single line of code.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss4kklflbiju26vz6u88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss4kklflbiju26vz6u88.png" alt="git reflog HEADs" width="800" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is why &lt;code&gt;git reflog&lt;/code&gt; is so powerful. It shows you every &lt;code&gt;HEAD&lt;/code&gt; movement for at least 30 days by default. You can see where a rebase started, where it ended, and every reset or checkout in between.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scenarios when you may need git reflog
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You ran a &lt;code&gt;git reset&lt;/code&gt; or &lt;code&gt;git rebase&lt;/code&gt; and realise you reset too far.&lt;/li&gt;
&lt;li&gt;Your editor or terminal crashed during a Git operation.&lt;/li&gt;
&lt;li&gt;You accidentally amended or squashed a commit you still needed.&lt;/li&gt;
&lt;li&gt;You switched branches and then realised you needed the unmerged work.&lt;/li&gt;
&lt;li&gt;You want to recover lost references after a forced push or merge conflict.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other useful Git commands
&lt;/h2&gt;

&lt;p&gt;There are many Git commands that complement &lt;code&gt;git reflog&lt;/code&gt; and help you manage your history safely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git stash&lt;/code&gt; to save uncommitted changes before switching tasks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git reset --soft&lt;/code&gt; to move &lt;code&gt;HEAD&lt;/code&gt; without losing your working directory changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git cherry-pick&lt;/code&gt; to apply a single commit from another branch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git revert&lt;/code&gt; to create a new commit that undoes a previous one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Learning these commands gives you fine-grained control over your history and workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leverage Git like a superpower
&lt;/h2&gt;

&lt;p&gt;When you master Git, you can recover from almost any mistake. You gain confidence to try daring refactors, experiment without fear, and fix critical bugs under pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always push to a remote branch
&lt;/h2&gt;

&lt;p&gt;While &lt;code&gt;git reflog&lt;/code&gt; can save you locally, it is still best practice to push your work to a remote repository frequently. If you are mid-feature, add a &lt;code&gt;WIP&lt;/code&gt; prefix (Work In Progress) to your commit messages so teammates know it is not final. When the feature is complete, squash or clean up your commits before merging.&lt;/p&gt;

&lt;p&gt;I once had my PC die without warning on a Monday morning and I had few days left to deadline. Fortunately I had pushed every change to a remote branch. I cloned the repo on another machine and continued coding immediately. I lost only the hardware, not my work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git reflog&lt;/code&gt; is your safety net when Git operations go sideways. It records every &lt;code&gt;HEAD&lt;/code&gt; movement so you can recover lost commits, undone changes, and interrupted rebases. Combine it with &lt;code&gt;git stash&lt;/code&gt;, &lt;code&gt;git reset&lt;/code&gt;, and regular pushes to a remote repo, and you will never have to fear losing your code again.&lt;/p&gt;

&lt;p&gt;Thank you for reading. I hope this makes you more confident in handling Git. Share your own stories or questions in the comments, I would love to hear how &lt;code&gt;git reflog&lt;/code&gt; or a similar git command has saved your day.&lt;/p&gt;

&lt;p&gt;You can always reach out if you have any gigs, offers, or questions!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stanleyazi.me" rel="noopener noreferrer"&gt;Stanley Azi&lt;/a&gt;&lt;br&gt;
Full‑Stack Engineer | Frontend Specialist&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>“It’s clear you are better than the reviewer” - said a Senior Software Engineer</title>
      <dc:creator>Stanley Azi</dc:creator>
      <pubDate>Fri, 16 May 2025 16:13:45 +0000</pubDate>
      <link>https://dev.to/stan015/its-clear-you-are-better-than-the-reviewer-said-a-senior-software-engineer-55jp</link>
      <guid>https://dev.to/stan015/its-clear-you-are-better-than-the-reviewer-said-a-senior-software-engineer-55jp</guid>
      <description>&lt;p&gt;I got selected to move forward for a Software Engineer (Frontend) role with a foreign company from a cold DM and was given a test assignment. I delivered beyond the expected result, only to receive feedback from a review that seemed out of touch with current web development best practices, especially within the Vue 3 and Nuxt 3 ecosystem. A senior engineer who looked over my work remarked, “It’s clear you are better than the reviewer,” which inspired me to share this story.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Flawed Review
&lt;/h2&gt;

&lt;p&gt;The review listed several shortcomings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No Composition API usage.&lt;/li&gt;
&lt;li&gt;No project architecture.&lt;/li&gt;
&lt;li&gt;Code repetitiveness.&lt;/li&gt;
&lt;li&gt;No cards stored in localStorage.&lt;/li&gt;
&lt;li&gt;Not following the Figma design.&lt;/li&gt;
&lt;li&gt;Bugs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Many of these points were vague or incorrect. Let’s examine each claim.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Composition API Usage
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “No composition (Vue 3)”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; Every component in the assignment used Vue 3’s Composition API with &lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt;, &lt;code&gt;defineProps&lt;/code&gt;, &lt;code&gt;defineEmits&lt;/code&gt;, reactive &lt;code&gt;ref()&lt;/code&gt;, and other variables. This is idiomatic Vue 3 by design, enabling cleaner logic and better type inference with TypeScript. &lt;/p&gt;

&lt;p&gt;Vue's &lt;a href="https://vuejs.org/api/sfc-script-setup" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; recommends &lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; for Vue 3 and Nuxt 3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte7uo21sjwhmfxao7bcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte7uo21sjwhmfxao7bcz.png" alt="Vue's doc on composition API" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The below component clearly shows the use of composition API which was used in every single vue component in the codebase with typescript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhk5nyv39v2e5xgv0lyqa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhk5nyv39v2e5xgv0lyqa.png" alt="Proof of composition API" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Lesson:&lt;/em&gt;&lt;/strong&gt; Always verify the reviewer’s technical context before accepting their conclusions.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Project Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “No project architecture”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; The project follows Nuxt 3’s opinionated file-based architecture, which is industry-standard and recommended in the official documentation. The structure includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;components/&lt;/code&gt;, &lt;code&gt;composables/&lt;/code&gt;, &lt;code&gt;stores/&lt;/code&gt;, &lt;code&gt;utils/&lt;/code&gt;, &lt;code&gt;types/&lt;/code&gt;, &lt;code&gt;pages/&lt;/code&gt;, and &lt;code&gt;server/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type safety with TypeScript&lt;/li&gt;
&lt;li&gt;Organized assets and server logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Calling this “no architecture” is, frankly, misleading.&lt;/p&gt;

&lt;p&gt;This structure aligns perfectly with &lt;a href="https://nuxt.com/docs/guide/directory-structure" rel="noopener noreferrer"&gt;Nuxt’s official guidelines&lt;/a&gt; and scales well for large applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foovr8l4kzlpwg6qnmcrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foovr8l4kzlpwg6qnmcrt.png" alt="Nuxt 3 file-based archetecture" width="800" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Approach Hint:&lt;/strong&gt;&lt;/em&gt; Embrace framework conventions to streamline setup and reduce boilerplate.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Code Repetitiveness
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “Code repetitiveness”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; I built reusable components to avoid duplication wherever practical. Any repetition, such as Tailwind utility classes or minimal logic blocks, is contextually appropriate and does not constitute a flaw without concrete examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Hint at Organization:&lt;/em&gt;&lt;/strong&gt; Group similar UI elements into shared components; use design tokens or helper functions for common patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Card Persistence (LocalStorage)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “No cards storing (local storage)”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; The assignment’s &lt;em&gt;Technical Requirements&lt;/em&gt; specified using the &lt;strong&gt;Composition API&lt;/strong&gt; and &lt;strong&gt;Pinia&lt;/strong&gt; for state management; it did not mandate data persistence. I implemented every requested feature; UI interactions, CRUD workflows, and design fidelity. If localStorage persistence was expected, it should have been explicitly outlined.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yd4w34tnm8qj3s8c45j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yd4w34tnm8qj3s8c45j.png" alt="Technical requirements" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using localStorage would be a reasonable enhancement, but the task did not explicitly require persistence. The Technical Requirements section clearly mentions using the Composition API and Pinia store, both of which were implemented. The task primarily focused on UI functionality, the CRUD workflow, and accurate design implementation, all of which were completed. If persistence was an expectation, it should have been clearly stated in the task description.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Design Fidelity
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “Not following Figma design”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; I matched structure, colors, spacing, and typography to the Figma mockups. Minor pixel adjustments may vary across environments, but no significant deviations occurred. All UI screenshots that were attached to the feedback were basic to fix and the feedback got me wondering what the use of &lt;em&gt;'code-review before merging to main'&lt;/em&gt; is for?&lt;/p&gt;

&lt;p&gt;How on earth could a good reviewer point out inline padding on a closely implemented button that functions perfectly as a flaw, while ignoring everything else; pixel-perfect UIs, 100% functional implementation, ~100% performance, accessibility, SEO, best practices, speed, and animations? I mean, just look at what the reviewer is pointing out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8r4zpkryumjb2po4lqls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8r4zpkryumjb2po4lqls.png" alt="Filter buttons comparisons" width="411" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not a single review mentions key functionalities, performance, Git branching and commit messages, best practices, or the cool transitions shown below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Scored ~100/100 scores on both Lighthouse and PageSpeed performance, accessibility, best practices, and SEO:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn57mg0bprkkvfi70h2u1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn57mg0bprkkvfi70h2u1.png" alt="Performance" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git branching and commit messages best practice:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhwh82zuycvrakn1azri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhwh82zuycvrakn1azri.png" alt="Clear git history" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I mean, look at the performance stats, near-perfect Core Web Vitals, optimised asset loading, and a responsive, accessible layout. Yet the review chose to ignore all of that and instead pointed out something like button padding as a flaw.&lt;/p&gt;

&lt;p&gt;It’s critical to understand that web development is far more than what you see on the surface. Good reviews go beyond static visuals and evaluate architecture, performance, maintainability, and user experience holistically.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip for Collaboration:&lt;/em&gt; If you spot a potential mismatch, always provide annotated screenshots, clear examples, or Git-style code review comments referencing the specific line or component, it saves everyone time and confusion. Also, know the weight of what you're pointing out. A slight inline padding difference is not a breaking change and should be treated as a minor refinement, not a critical flaw. Context matters when reviewing work, not all mismatches are created equal.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Bugs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reviewer’s Claim:&lt;/strong&gt; “Bugs”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; The only minor issue involved checkbox selection logic, a trivial fix by targeting checkboxes via unique IDs. Moreover, displaying a fallback message when a card ID doesn’t exist is a deliberate, user-friendly enhancement, not a defect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvdyjqukf2ccopcic3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8gvdyjqukf2ccopcic3f.png" alt="fall-back message" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Best Practice:&lt;/em&gt; Provide meaningful defaults for nonexistent data to avoid blank screens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways &amp;amp; Moving Forward
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verify feedback&lt;/strong&gt; with examples: Vague criticisms aren’t actionable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage framework conventions&lt;/strong&gt; for rapid, maintainable development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communicate clearly&lt;/strong&gt; about expected features vs. nice-to-haves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embrace constructive critique&lt;/strong&gt; while standing by correct implementations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a senior engineer affirms your strength, it’s a reminder to trust your expertise and seek reviewers who understand the technologies you use. Stay confident, keep learning, and always aim for clarity in both code and communication.&lt;/p&gt;

&lt;p&gt;Thank you for reading this part of my story-turned-article. What are your thoughts on my experience?&lt;/p&gt;

&lt;p&gt;Let’s keep building amazing things and expanding our skills.&lt;/p&gt;

&lt;p&gt;Have any gig, offer, or questions for me? You can always hit me up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stanleyazi.me" rel="noopener noreferrer"&gt;Stanley Azi&lt;/a&gt;,&lt;br&gt;
Full-Stack Engineer | Frontend Specialist&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vue</category>
      <category>nuxt</category>
      <category>career</category>
    </item>
    <item>
      <title>From Side Projects to Job Offers: The Hidden Value of Your First Tech Projects and Articles</title>
      <dc:creator>Stanley Azi</dc:creator>
      <pubDate>Wed, 12 Mar 2025 06:59:13 +0000</pubDate>
      <link>https://dev.to/stan015/from-side-projects-to-job-offers-the-hidden-value-of-your-first-tech-projects-and-articles-5619</link>
      <guid>https://dev.to/stan015/from-side-projects-to-job-offers-the-hidden-value-of-your-first-tech-projects-and-articles-5619</guid>
      <description>&lt;p&gt;The projects you built and the articles you wrote in the early stages of your tech career could be the ones that speak for you and help you land more contracts when you finally reach the stage of seeking gigs and offers.&lt;/p&gt;

&lt;p&gt;Early projects serve as real evidence of your skills. They show potential employers or clients that you are more than just a list of technical abilities on a resume. Instead of merely claiming to have knowledge in HTML, CSS, JavaScript, and accessibility, you provide tangible proof that you can apply these skills to build engaging and effective solutions.&lt;/p&gt;

&lt;p&gt;For example, I built &lt;a href="https://scissorcut.vercel.app/" rel="noopener noreferrer"&gt;ScissorCut&lt;/a&gt;, a project that has always stood out for its excellent front end user interfaces and astonishing animations. I have had clients mention that this project caught their eye and prompted them to reach out. However, I still remember that ScissorCut was just a small project I built while learning HTML, CSS and JavaScript, the very fundamentals of a successful tech (frontend) career. I am amazed by how this project consistently receives positive feedback, even though it is simply a landing page featuring impressive pure CSS animations. This is a testament to the power of project-based learning. &lt;em&gt;Don’t just watch tutorials, attend classes and read documentation. &lt;strong&gt;Build projects with what you have learned!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1mxfue3z2f59convurgj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1mxfue3z2f59convurgj.png" alt="laptop on a desk" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Beyond projects, &lt;strong&gt;technical articles can be game-changers in interviews.&lt;/strong&gt; Writing about a topic means you’ve broken it down, researched it deeply, and explained it in a way others can understand. My article &lt;strong&gt;"&lt;a href="https://dev.to/stan015/rendering-images-the-good-way-in-your-react-application-3fdl"&gt;Rendering Images the Good Way in Your React Application&lt;/a&gt;"&lt;/strong&gt; has repeatedly served as a powerful asset in interviews. When asked about optimising images for performance, I don’t just answer, I reference my article, detailing how I’ve tackled the issue in real-world applications like &lt;strong&gt;&lt;a href="https://sabinus.meme" rel="noopener noreferrer"&gt;Sabinus.meme&lt;/a&gt;&lt;/strong&gt;, where I optimised and rendered high-quality images efficiently. This immediately convinces interviewers or clients that I don’t just understand the topic, I’ve applied it at a professional level.&lt;/p&gt;

&lt;p&gt;These proofs have helped me land promising gigs. During a recent Upwork interview, I showcased my work and discussed how I solved similar challenges in the past. The discussion was convincing and played a significant role in securing the gig. This experience reinforces the idea that a portfolio of early projects and well researched articles can truly be the key to opening doors in the competitive tech industry.&lt;/p&gt;

&lt;p&gt;Although my articles represent my personal opinions and serve as a reminder for me to put in more work, I enjoy sharing them with the public because my followers appreciate the insights. If you find this article insightful, give it a thumbs up and follow for more tech tips. &lt;/p&gt;

&lt;p&gt;I am open to frontend and full-stack engineering roles and gigs. Let’s work on your project.&lt;/p&gt;

&lt;p&gt;Thanks for reading through to the end!&lt;/p&gt;

&lt;p&gt;Let’s keep learning and improving our tech skills by building projects and showcasing our work.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>sideprojects</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Properly Structure HTML for Easy CSS Styling</title>
      <dc:creator>Stanley Azi</dc:creator>
      <pubDate>Sun, 09 Mar 2025 23:25:20 +0000</pubDate>
      <link>https://dev.to/stan015/properly-structure-html-for-easy-css-styling-45a8</link>
      <guid>https://dev.to/stan015/properly-structure-html-for-easy-css-styling-45a8</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;How to structure HTML effectively for seamless CSS styling?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is a fundamental aspect of web development that can significantly enhance both the maintainability and scalability of your projects. Let's look at some essential practices to achieve this.&lt;/p&gt;

&lt;p&gt;Firstly, It's worth noting that getting good at these technologies is not rocket science. Following roadmaps and useful resources available on the internet can help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Master the Basics of HTML
&lt;/h2&gt;

&lt;p&gt;It's crucial to approach HTML with the seriousness it deserves. Despite common misconceptions that HTML is overly simplistic or not a "real" programming language, understanding its intricacies is vital for any web developer. Familiarise yourself with every HTML5 element and its specific purpose to avoid the common pitfall of overusing generic &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tags. This knowledge forms the foundation upon which efficient and effective web pages are built.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understand Document Structure
&lt;/h2&gt;

&lt;p&gt;A well-structured HTML document is divided into &lt;strong&gt;two main sections&lt;/strong&gt;: the &lt;strong&gt;&lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;&lt;/strong&gt; and the &lt;strong&gt;&lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;&lt;/strong&gt;. The &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; contains meta-information, links to stylesheets, and scripts, while the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; encompasses the content visible to users. Grasping this distinction ensures that you place elements in their appropriate locations, leading to better organisation and easier styling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Embrace Semantic HTML
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dujmp6p0hy827w0gx4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dujmp6p0hy827w0gx4d.png" alt="semantic html" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Semantic HTML involves using elements that convey meaning about the content they contain, such as &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;. This practice not only enhances accessibility but also provides clear hooks for CSS styling. For instance, wrapping navigation links (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;) within a &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; tag inside a &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; that also contains your logo allows for targeted and efficient CSS rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply Logical Structuring
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k3ubxo1ufq0n5ifofy5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k3ubxo1ufq0n5ifofy5.png" alt="code" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When organising your HTML, think critically about the hierarchy and relationship between elements. Consider whether wrapping certain elements in additional containers, such as &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tags, is necessary for styling purposes. This logical structuring facilitates more straightforward and effective CSS application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prioritise Accessibility (a11y)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckgtqh1zvd1j2ecng96p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckgtqh1zvd1j2ecng96p.png" alt="laptop" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accessibility is a crucial aspect of web development that benefits all users, including those relying on assistive technologies. Incorporating accessibility features can also simplify CSS styling by allowing you to target elements based on accessibility attributes without additional JavaScript. Applying more accessibility practices enhances both the usability and style-ability of your web pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leverage Modern CSS Features
&lt;/h2&gt;

&lt;p&gt;CSS has evolved significantly, introducing features that simplify complex styling tasks. Familiarising yourself with modern CSS capabilities, such as Flexbox, Grid Layout, and custom properties (variables), can drastically improve your styling efficiency and effectiveness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Learning and Resource Utilisation
&lt;/h2&gt;

&lt;p&gt;The field of web development is ever-evolving, making continuous learning essential. Utilise reputable resources to stay updated and deepen your understanding. Some valuable resources include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://htmlreference.io/" rel="noopener noreferrer"&gt;HTML Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/learn/html" rel="noopener noreferrer"&gt;Web.dev's HTML Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://html.com/" rel="noopener noreferrer"&gt;HTML.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Formal education opportunities are also worth considering, such as courses offered by AltSchool Africa, to further enhance your skills.&lt;/p&gt;

&lt;p&gt;By implementing these practices and committing to learning more to improve your skills, you'll observe significant improvements in your web development capabilities over time. Remember, progress is a gradual process, advance at your own pace, filter out discouragement, and maintain focus on mastering your craft.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>Rendering Images The Good Way In Your React Application</title>
      <dc:creator>Stanley Azi</dc:creator>
      <pubDate>Mon, 17 Jun 2024 21:36:45 +0000</pubDate>
      <link>https://dev.to/stan015/rendering-images-the-good-way-in-your-react-application-3fdl</link>
      <guid>https://dev.to/stan015/rendering-images-the-good-way-in-your-react-application-3fdl</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Most times on my initial visit to a website, I take my time to observe and enjoy how images are rendered. In fact, if the website happens to include an image on their hero section, that is what first catches my attention before I go ahead to read the texts on the page.&lt;/p&gt;

&lt;p&gt;Visual appealing images aids good User Experience (UX) while browsing a web or mobile application. It also play a crucial role in beautifying the User Interface (UI). In some cases, images speaks louder than the texts associated with it.&lt;/p&gt;

&lt;p&gt;Rendering images poorly in your application could harm your UI, thereby causing bad UX. In this article, I will walk you through &lt;em&gt;"rendering images the good way in your react application".&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;This article is for everyone who loves building and beautifying web and mobile applications, and those who use them. However, having basic understanding of the below tools and concepts in web development is a plus as we would write some code to better explain some concepts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Frontend Development (HTML/CSS/JS)&lt;/li&gt;
&lt;li&gt;Basic Knowledge of React&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What does Image Rendering mean?
&lt;/h2&gt;

&lt;p&gt;Image Rendering is the process of displaying images on the UI of an application for the users to see and interact with them. When you visit an application and an image gets loaded on the screen, that process of the image loading is what is referred to as &lt;em&gt;Image Rendering&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should we care about how images are rendered?
&lt;/h2&gt;

&lt;p&gt;There are more to &lt;em&gt;Image Rendering&lt;/em&gt; than just loading images on the User Interface (UI). If images are not properly rendered, they tend to make a bad UI and even harm User Experience (UX). This is why &lt;em&gt;proper image rendering&lt;/em&gt; is considered a critical skill every Frontend Developer should possess. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to render images the good way in a react app?
&lt;/h2&gt;

&lt;p&gt;The basic rendering of images in most Frontend Web Development languages, libraries and frameworks follow a simply convention where the HTML &lt;code&gt;img&lt;/code&gt; element is used. The &lt;code&gt;img&lt;/code&gt; tag primarily consists of two major standard attributes; &lt;code&gt;src&lt;/code&gt; and &lt;code&gt;alt&lt;/code&gt; attributes. The &lt;code&gt;src&lt;/code&gt; attribute takes a string of the url or the relative path of the image to be rendered, while the &lt;code&gt;alt&lt;/code&gt; attribute takes a string containing a description of the image to be rendered. The description provided in the &lt;code&gt;alt&lt;/code&gt; attribute is what would be rendered if the image is broken or failed to render. The &lt;code&gt;alt&lt;/code&gt; attribute also aids accessibility (a11y) by describing to screen readers what the image is. Other &lt;code&gt;img&lt;/code&gt; tag standard attributes include &lt;code&gt;srcset&lt;/code&gt;, &lt;code&gt;sizes&lt;/code&gt;, &lt;code&gt;loading&lt;/code&gt;, &lt;code&gt;crossorigin&lt;/code&gt;, &lt;code&gt;usemap&lt;/code&gt;, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6fk4kvbm2s1q9cxjsydk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6fk4kvbm2s1q9cxjsydk.jpg" alt="HTML img tag attributes' meaning breakdown" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React renders HTML elements using JSX. The JSX translates to HTML under the hood. &lt;/p&gt;

&lt;p&gt;In order to render images the good way in a react application, below are the tips and tricks that would magnify how they are rendered by react:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Emphases on the alt attribute
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;alt&lt;/code&gt; attribute is very important and should never be omitted when rendering images with the &lt;code&gt;img&lt;/code&gt; tag. The &lt;code&gt;alt&lt;/code&gt; attribute does not only display the provided description when the image failed to load, but also play a crucial role in aiding a11y by providing screen readers contents to read out to the user about the image. I have once debugged someone's code and discovered that all &lt;code&gt;img&lt;/code&gt; tags in the entire code base does not have &lt;code&gt;alt&lt;/code&gt; attribute, I had to include it and provide good description for each each image. Not including the &lt;code&gt;alt&lt;/code&gt; attribute is a bad practice and should be avoided at all times. &lt;br&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Do:&lt;/strong&gt;&lt;/em&gt; &lt;code&gt;&amp;lt;img src="imageURL/relativePath" alt="a good image description" /&amp;gt;&lt;/code&gt; &lt;br&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Don't:&lt;/strong&gt;&lt;/em&gt; &lt;del&gt;&lt;code&gt;&amp;lt;img src="imageURL/relativePath" /&amp;gt;&lt;/code&gt;&lt;/del&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Best image format and file size
&lt;/h3&gt;

&lt;p&gt;Generally, the image file format and size matters a lot. They determine the clarity and the speed at which the image is loaded.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The smaller the image size, the faster it would render.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is highly recommended that the file format for icons and small graphics should always be &lt;strong&gt;&lt;em&gt;SVG&lt;/em&gt;&lt;/strong&gt; as they are usually smaller in size and scalable.&lt;br&gt;
&lt;code&gt;&amp;lt;img src="iconUrl.svg" alt="a good icon description" /&amp;gt;&lt;/code&gt; &lt;br&gt;&lt;br&gt;
The &lt;strong&gt;&lt;em&gt;WebP&lt;/em&gt;&lt;/strong&gt; format is one of the best formats to save and render images of high quality and size. It is a modern format that provides great compression and high quality when compared to old formats like &lt;em&gt;&lt;strong&gt;JPEG&lt;/strong&gt;&lt;/em&gt; and &lt;strong&gt;&lt;em&gt;PNG&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageUrl.webp" alt="a good image description" /&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4rhka0cq1dmznvzjsw7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4rhka0cq1dmznvzjsw7g.png" alt="squoosh.app image format converter" width="800" height="461"&gt;&lt;/a&gt;&lt;br&gt;
The image above shows an image format conversion from &lt;strong&gt;&lt;em&gt;JPG&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;WebP&lt;/em&gt;&lt;/strong&gt; using &lt;strong&gt;Squoosh.app&lt;/strong&gt;. In this conversion, the 2.79MB &lt;strong&gt;&lt;em&gt;JPG&lt;/em&gt;&lt;/strong&gt; image (see bottom-left corner of the image) was converted to a 705kB &lt;strong&gt;&lt;em&gt;WebP&lt;/em&gt;&lt;/strong&gt; format, saving 75% of the file size while still maintaining the image quality (see bottom-right). You can further adjust the quality and compare the difference by dragging the divider left-right to get smaller size. &lt;strong&gt;Squoosh.app&lt;/strong&gt; is a great tool for image conversion that does not upload your image elsewhere as you are basically doing all your conversion offline and with your computer, and it has a download button that you can click to simply save your file after conversion. The &lt;strong&gt;Squoosh.app&lt;/strong&gt; also converts to other image formats which you can explore.&lt;br&gt;&lt;br&gt;
Other image formats (e.g, &lt;strong&gt;&lt;em&gt;JPEG&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;PNG&lt;/em&gt;&lt;/strong&gt;) are still valid and can be used if the image size is small, but should be used with caution. Since &lt;strong&gt;&lt;em&gt;WebP&lt;/em&gt;&lt;/strong&gt; saves us a lot image size while still maintaining high quality, why not just use it all the time in your application? Its support across browsers as at the date of the publish of this article is &lt;em&gt;96.9%&lt;/em&gt;, which means it has good support across all major browsers.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Proper image box sizing
&lt;/h3&gt;

&lt;p&gt;Providing a proper size for the image to be rendered should be practiced. This backs the certainty of the image fitting the available space for it across screens as desired. The intrinsic sizing being discussed in this case include &lt;code&gt;width&lt;/code&gt;, &lt;code&gt;height&lt;/code&gt; and &lt;code&gt;aspect-ratio&lt;/code&gt;. &lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageURL/relativePath" alt="a good image description" width="200px" height="300px" /&amp;gt;&lt;/code&gt; &lt;br&gt;&lt;br&gt;
The image sizing, just like every other HTML element, could be styled inline, internally or with an external css file. &lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageURL/relativePath" alt="a good image description" /&amp;gt;&lt;/code&gt;&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="nt"&gt;img&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;200px&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;300px&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;&lt;br&gt;
 If the image is wrapped with a container, e.g &lt;code&gt;div&lt;/code&gt; or &lt;code&gt;span&lt;/code&gt;, and the desire is to make it cover the container, in most cases the container would take the size of the &lt;code&gt;img&lt;/code&gt; tag. But if the container has a specified width and height, the &lt;code&gt;img&lt;/code&gt; tag could be given a relative value (e.g &lt;code&gt;width="100%"&lt;/code&gt;), although this should be applied with careful examination as the &lt;code&gt;aspect-ratio&lt;/code&gt; of the image may affect the styling and should be adjusted accordingly.&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;width=&lt;/span&gt;&lt;span class="s"&gt;"200px"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"300px"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"imageURL/relativePath"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 In order for &lt;code&gt;aspect-ratio&lt;/code&gt; to take effect, at least one of the image sizes must be &lt;code&gt;auto&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageUrl/relativePath" alt="a good image description" width="200px" height="auto" aspect-ratio="1/1" /&amp;gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Sizing the image is one of the basic good practice that aids good User Interface (UI). When an image is properly sized, you are certain as a Frontend Developer that its shape across screens gives a pleasing view to the user.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Lazy loading
&lt;/h3&gt;

&lt;p&gt;Diving deeper into &lt;em&gt;"rendering images the good way"&lt;/em&gt;, one of the critical aspect to be considered is &lt;em&gt;how&lt;/em&gt; the image is rendered. One of the key ways to render an image wholly is to lazy-load it. This ensures that the image is in the viewport and has fully been loaded before displaying it on the UI. To achieve this, you can use the &lt;code&gt;img&lt;/code&gt; tag loading attribute where you set the value to &lt;em&gt;"lazy"&lt;/em&gt;, or you can use other small-size React image lazy-loading libraries that may include extra loading features. &lt;br&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  - &lt;u&gt;&lt;em&gt;The loading attribute&lt;/em&gt;&lt;/u&gt;
&lt;/h4&gt;

&lt;p&gt;The loading attribute gives us the ability to control how the image is rendered. It helps to command the image to either load immediately the UI is loaded regardless of whether the image is in the viewport (&lt;code&gt;loading="eager"&lt;/code&gt;), or load only when the image reaches a certain viewport (&lt;code&gt;loading="lazy"&lt;/code&gt;). This means that the &lt;code&gt;loading&lt;/code&gt; attribute can take values, &lt;em&gt;eager&lt;/em&gt; and &lt;em&gt;lazy&lt;/em&gt;. By default, images are rendered eagerly (&lt;code&gt;loading="eager"&lt;/code&gt;).&lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageURL/relativePath" alt="a good image description" loading="eager" /&amp;gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;img src="imageURL/relativePath" alt="a good image description" loading="lazy" /&amp;gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Lazy-loading images generally improves image rendering. It ensures that the image only loads when needed, and in most cases, it forces the image to only display when it is fully ready, thereby preventing the image from rendering part-by-part on slow or poor network. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv3i4bnejt3ngm9czqtv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv3i4bnejt3ngm9czqtv.png" alt="img tag loading attribute" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  - &lt;em&gt;&lt;u&gt;React lazy-loading libraries&lt;/u&gt;&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Using a third-party library to lazy-load images is also an option. One may prefer to use a library which simply involves installing and importing the library, and then using it to control the &lt;code&gt;img&lt;/code&gt; tag in your application as the library's documentation suggests. Although in most cases, using the &lt;code&gt;loading&lt;/code&gt; attribute works just fine rather than importing a third-party library if you are rendering a few simple images with less configurations. Using a third-party library was preferred due to its extra features and poor browser support for the &lt;code&gt;loading&lt;/code&gt; attribute in the past, but as at the time of the publish of this article, the &lt;code&gt;img&lt;/code&gt; tag &lt;code&gt;loading&lt;/code&gt; attribute is 95.73% supported across all major browsers, which means it's safe to simple use the &lt;code&gt;loading&lt;/code&gt; attribute to lazy-load images. &lt;br&gt;&lt;br&gt;
Further more on the third-party library option, there are two React lazy-loading libraries I recommend for use; they are &lt;strong&gt;&lt;em&gt;react-lazyload&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;react-lazy-load-image-component&lt;/em&gt;&lt;/strong&gt;. Both libraries supports lazy-loading images and components. &lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;react-lazyload:&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installation:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;pnpm install --save react-lazyload&lt;/code&gt; &lt;br&gt;&lt;br&gt;
&lt;strong&gt;Basic Usage&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;LazyLoad&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-lazyload&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
     &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Lazy loaded image&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;LazyLoad&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt; &lt;span class="na"&gt;placeholder&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;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&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;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; 
        &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"imageURL/relativePath"&lt;/span&gt; 
        &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt; 
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"200px"&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"300px"&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;LazyLoad&lt;/span&gt;&lt;span class="p"&gt;&amp;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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&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;strong&gt;&lt;em&gt;react-lazyload&lt;/em&gt;&lt;/strong&gt; library wraps the &lt;code&gt;img&lt;/code&gt; tag with it's &lt;code&gt;LazyLoad&lt;/code&gt; component just as shown in the code block above. It can only wrap one child &lt;code&gt;img&lt;/code&gt; tag at a time. This library performs well with speed at which it renders images. Its simplicity and features makes it unique. Some of the props the &lt;code&gt;LazyLoad&lt;/code&gt; component can take include placeholder, once, height, unmountIfInvisible, debounce/throttle, overflow, etc.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;react-lazy-load-image-component library:&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Installation:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;pnpm i --save react-lazy-load-image-component&lt;/code&gt; &lt;br&gt;&lt;br&gt;
&lt;strong&gt;Basic Usage&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LazyLoadImage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-lazy-load-image-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
     &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Lazy loaded image&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;LazyLoadImage&lt;/span&gt;
        &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"imageURL/relativePath"&lt;/span&gt;
        &lt;span class="na"&gt;placeholder&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;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&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="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt;
        &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"400px"&lt;/span&gt;
        &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"600px"&lt;/span&gt; 
      &lt;span class="p"&gt;/&amp;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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The features of this library makes it easier to handle the loading state of the image. Unlike &lt;strong&gt;&lt;em&gt;react-lazyload&lt;/em&gt;&lt;/strong&gt; library which wraps the &lt;code&gt;img&lt;/code&gt; tag with an opening and closing tag (&lt;code&gt;&amp;lt;LazyLoad&amp;gt;&amp;lt;img src=“” alt=“” /&amp;gt;&amp;lt;/LazyLoad&amp;gt;&lt;/code&gt;), this library makes it seem as though you are still using the &lt;code&gt;img&lt;/code&gt; tag, you simply replace the &lt;code&gt;img&lt;/code&gt; with &lt;code&gt;LazyLoadImage&lt;/code&gt; and all the attributes of &lt;code&gt;img&lt;/code&gt; tag can be passed to the &lt;code&gt;LazyLoadImage&lt;/code&gt; component as props. &lt;strong&gt;React-lazy-load-image-component&lt;/strong&gt; library performs great when the images to be rendered are many, it ensures that only images that would fit the viewport are fetched, the more you scroll, the more it fetches, saving the amount of network requests that would have been made if all images were to be fetched at once. The props that could be passed to this component aside all &lt;code&gt;img&lt;/code&gt; tag attributes include placeholderSrc, threshold, effect, useIntersectionObserver, debounce/throttle, onLoad, beforeLoad, afterLoad, placeholder, etc. &lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Responsive Images
&lt;/h3&gt;

&lt;p&gt;Generally, &lt;em&gt;responsiveness&lt;/em&gt; is a very important aspect of Frontend Development that ensures that all UI components and elements of an application are displayed in correct sizes across devices. The concept of displaying the correct size of an element with respect to the device's screen size can be applied to the &lt;code&gt;img&lt;/code&gt; tag with the &lt;code&gt;srcset&lt;/code&gt; attribute for image rendering, where different sizes are passed to the &lt;code&gt;sizes&lt;/code&gt; attribute with respect to the number of image URL passed to the &lt;code&gt;srcset&lt;/code&gt; attribute.&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;img&lt;/span&gt; 
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"imageURL-small"&lt;/span&gt; 
  &lt;span class="na"&gt;srcSet=&lt;/span&gt;&lt;span class="s"&gt;"imageURL-small 500w, imageURL-medium 1000w, imageURL-large 1500w"&lt;/span&gt;
  &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"(max-width: 600px) 480px, (max-width: 1200px) 800px, 1200px"&lt;/span&gt;
  &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt; 
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code block shows a basic application of responsive image where different image URLs were provided in the &lt;code&gt;srcset&lt;/code&gt; attribute, and their respective sizes were provided and separated with commas (,) in the &lt;code&gt;sizes&lt;/code&gt; attribute. This ensures that the correct size of the device screen size is loaded, which improves rendering speed with respect to the image file size. A default URL is passed to the &lt;code&gt;src&lt;/code&gt; attribute.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Progressive Image Loading
&lt;/h3&gt;

&lt;p&gt;The concept of &lt;em&gt;progressive image loading&lt;/em&gt; involves rendering a low-quality image placeholders (LQIP) or a blurred version of the original image to be displayed while it is loading. A typical example of this type of image rendering is seem on &lt;strong&gt;unsplash.com&lt;/strong&gt; and &lt;strong&gt;pexels.com&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjint2yrcu8vvcr5fdf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjint2yrcu8vvcr5fdf3.png" alt="progressive image loading" width="800" height="525"&gt;&lt;/a&gt;&lt;br&gt;
I personally recommend rending images progressively as it gives your users/visitors a picture of what is expected to be loaded. This improves both UI and UX because it initially occupy a space for the loading image which prevents Cumulative Layout Shift (CLS), and also provide the user a hint of what is loading. &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Implementation of Progressive Image Loading with BlurHash in React&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;BlurHash is a compact representation of a placeholder for an image.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Installation:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;pnpm install --save blurhash react-blurhash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Structure of React Blurhash component&lt;/strong&gt;&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;Blurhash&lt;/span&gt;
  &lt;span class="na"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"LEHV6nWB2yk8pyo0adR*.7kCMdnj"&lt;/span&gt;
  &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;323&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;resolutionX&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;resolutionY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;punch&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&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;The React Blurhash components takes &lt;code&gt;hash&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt;, &lt;code&gt;height&lt;/code&gt;, &lt;code&gt;resolutionX&lt;/code&gt;, &lt;code&gt;resolutionY&lt;/code&gt;, and &lt;code&gt;punch&lt;/code&gt; as props. &lt;br&gt;
The &lt;code&gt;hash&lt;/code&gt; prop's value is a string of the encoded hash of the original image to be rendered. The &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; props can be a valid CSS string or number value for width and height of the Blurhash image. The &lt;code&gt;resolutionX&lt;/code&gt;, &lt;code&gt;resolutionY&lt;/code&gt; controls the horizontal axis and vertical axis resolution of the blurred image, while the &lt;code&gt;punch&lt;/code&gt; takes care of contrast of the blurred image. &lt;br&gt;&lt;/p&gt;

&lt;p&gt;To generate a BlurHash string, we would simply use the generator on the BlurHash website (&lt;strong&gt;blurha.sh&lt;/strong&gt;) for this article. On &lt;strong&gt;blurha.sh&lt;/strong&gt;, scroll down to find the image upload button, upload the image you need the BlurHash string for and copy the generated hash. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1gxitry80uwxqooxk0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1gxitry80uwxqooxk0f.png" alt="blurhash website" width="800" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Usage&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Blurhash&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-blurhash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;imageLoaded&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setImageLoaded&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;imageError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setImageError&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;imageSrc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setImageSrc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setImageSrc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;setImageLoaded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setImageError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;imageUrl/relativePath&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="p"&gt;[]);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;imageLoaded&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;imageError&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
         &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&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;Blurhash&lt;/span&gt;
             &lt;span class="na"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"LEHV6nWB2yk8pyo0adR*.7kCMdnj"&lt;/span&gt;
             &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt;
             &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt;
             &lt;span class="na"&gt;resolutionX&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
             &lt;span class="na"&gt;resolutionY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
             &lt;span class="na"&gt;punch&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="si"&gt;}&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;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&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;imageError&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;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Error loading image&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&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;imageSrc&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;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;imageSrc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt; &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&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;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;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;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above use case of the React BlurHash component, I manually handled the loading state and error state of the image without using a React library. The code simply uses &lt;code&gt;useEffect()&lt;/code&gt; to watch updates of the state of the rendering image. When the loading is &lt;code&gt;true&lt;/code&gt;, the BlurHash component is shown, but when the image is fully loaded, the original image is shown to replace the the BlurHash component, and on error, the error state becomes &lt;code&gt;true&lt;/code&gt; and an error message is displayed instead (in our case &lt;em&gt;'Error loading image'&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;You may be asking &lt;em&gt;why all these lines of code just to display an image?&lt;/em&gt;. The desire to better handle image rendering in React got us here. Although we can use a React library to save our time and reduce the lines of code. &lt;br&gt;&lt;br&gt;
&lt;strong&gt;Using &lt;em&gt;react-lazy-load-image-component&lt;/em&gt; library with BlurHash&lt;/strong&gt;&lt;br&gt;
The &lt;em&gt;react-lazy-load-image-component&lt;/em&gt; performs well with BlurHash when you simply pass the Bluhash component to its &lt;code&gt;placeholder&lt;/code&gt; prop.&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LazyLoadImage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-lazy-load-image-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Blurhash&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-blurhash&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Lazy loaded image&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&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;LazyLoadImage&lt;/span&gt;
          &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"imageUrl/relativePath"&lt;/span&gt;
          &lt;span class="na"&gt;placeholder&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;lt;&lt;/span&gt;&lt;span class="nc"&gt;Blurhash&lt;/span&gt; 
              &lt;span class="na"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"LEHV6nWB2yk8pyo0adR*.7kCMdnj"&lt;/span&gt;
              &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
              &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
              &lt;span class="na"&gt;resolutionX&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
              &lt;span class="na"&gt;resolutionY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
              &lt;span class="na"&gt;punch&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&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="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"a good image description"&lt;/span&gt;
          &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"400px"&lt;/span&gt;
          &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"600px"&lt;/span&gt;
        &lt;span class="p"&gt;/&amp;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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code block greatly reduced lines of code compared to when the image state was controlled manually. You can also decide to observe the loading state of the &lt;code&gt;LazyLoadImage&lt;/code&gt; component with the &lt;code&gt;onLoad&lt;/code&gt; prop and update the state when the image is loaded (e.g, &lt;code&gt;const [loading, setLoading] = useState(true)&lt;/code&gt;) rather than using the &lt;code&gt;placeholder&lt;/code&gt; prop. The &lt;code&gt;onLoad&lt;/code&gt; prop can be assigned a function that updates the loading state (e.g, &lt;code&gt;() =&amp;gt; setLoading(false)&lt;/code&gt;), which then gives the ability to conditionally display the &lt;code&gt;Blurhash&lt;/code&gt; component based on the loading state of the image. Although the option of using the &lt;code&gt;onLoad&lt;/code&gt; prop to manually manage loading state can cause Cumulative Layout Shift (CLS)  if the wrapper &lt;code&gt;div&lt;/code&gt; or &lt;code&gt;span&lt;/code&gt; containing the &lt;code&gt;Blurhash&lt;/code&gt; component and the &lt;code&gt;LazyLoadImage&lt;/code&gt; component is not properly styled.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Other Ways Of Rendering Images Efficiently
&lt;/h3&gt;

&lt;p&gt;There are lots of good ways of rendering images. This means we have options as developers. These options include, but are not limited to &lt;em&gt;Preloading Key Images&lt;/em&gt;, &lt;em&gt;Using Image CDN&lt;/em&gt;, &lt;em&gt;Using Background Images for Decorative Images&lt;/em&gt;, and &lt;em&gt;Exploring Other Methods Of Progressive Image Rendering&lt;/em&gt;.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Effectively rendering images in your application is crucial for optimizing performance and greatly improving User Experience (UX). Also, this great act makes your User Interface (UI) more charming and lovely to visit regularly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"When images are properly rendered on the UI of your application, kindly note that the joy I have in heart as your dearest user and frequent visitor is beyond imagination".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Always enable code analysis tools like ESLint in your coding environment to alert you when you make mistakes like forgetting to include the almighty important &lt;code&gt;alt&lt;/code&gt; attribute in your &lt;code&gt;img&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;As a Frontend Developer or a UI Engineer, make it a priority to render images following best practices that would greatly improve &lt;em&gt;how fast&lt;/em&gt; they are rendered by firstly considering the sizes and formats of your images before using them in your application.&lt;/p&gt;

&lt;p&gt;Thank you for reading through to this part of the article!&lt;br&gt;
Let's keep following best practices while coding! 🚀&lt;/p&gt;
&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;u&gt;React lazy-loading libriries&lt;/u&gt;&lt;/strong&gt; &lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/react-lazyload" rel="noopener noreferrer"&gt;&lt;em&gt;react-lazyload&lt;/em&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-lazy-load-image-component" rel="noopener noreferrer"&gt;&lt;em&gt;react-lazy-load-image-component&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;u&gt;Example websites that uses Progressive Image Loading&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://unsplash.com/" rel="noopener noreferrer"&gt;&lt;em&gt;unsplash.com&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pexels.com/" rel="noopener noreferrer"&gt;&lt;em&gt;pexels.com&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;u&gt;BlurHash&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/woltapp/react-blurhash" rel="noopener noreferrer"&gt;&lt;em&gt;React BlurHash github repo&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blurha.sh/" rel="noopener noreferrer"&gt;&lt;em&gt;BlurHash website: blurha.sh&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/blurhash" rel="noopener noreferrer"&gt;&lt;em&gt;BlurHash npm package&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. &lt;u&gt;Image format converter&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://squoosh.app/" rel="noopener noreferrer"&gt;&lt;em&gt;Squoosh&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>ui</category>
    </item>
  </channel>
</rss>
