<?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: Olukayode Asemudara</title>
    <description>The latest articles on DEV Community by Olukayode Asemudara (@theolukayodeasemudara).</description>
    <link>https://dev.to/theolukayodeasemudara</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%2F1276392%2F4fbf28c0-d602-4ded-ae83-b84065d68314.png</url>
      <title>DEV Community: Olukayode Asemudara</title>
      <link>https://dev.to/theolukayodeasemudara</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theolukayodeasemudara"/>
    <language>en</language>
    <item>
      <title>How to Fix Icons Not Displaying in React: A Simple Solution</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Fri, 09 May 2025 21:21:07 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/how-to-fix-icons-not-displaying-in-react-a-simple-solution-2dni</link>
      <guid>https://dev.to/theolukayodeasemudara/how-to-fix-icons-not-displaying-in-react-a-simple-solution-2dni</guid>
      <description>&lt;p&gt;If you're working on a React project and you've tried using icons but they aren't showing up, you're not alone. It’s a common issue that many React developers face. In this post, I’ll walk you through why your icons might not be displaying and how to fix it, using a super simple approach.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;Let’s say you’re using an icon library like &lt;strong&gt;React Icons&lt;/strong&gt; in your React project. You add the icon to your component, but instead of seeing the icon, nothing shows up. You check your code, and everything seems fine, but the icon is still missing.&lt;/p&gt;

&lt;p&gt;What’s happening here? 🤔&lt;/p&gt;

&lt;p&gt;The issue is that you're &lt;strong&gt;passing the icon component incorrectly&lt;/strong&gt;. In React, we need to pass components as &lt;strong&gt;JSX elements&lt;/strong&gt; to render them properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Cause
&lt;/h3&gt;

&lt;p&gt;If you’ve done something like this:&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="nx"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FaCode&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’re just passing a reference to the &lt;code&gt;FaCode&lt;/code&gt; component, but you're not &lt;strong&gt;actually rendering it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;React doesn't know that you want to display this icon as a part of your UI. It only sees the reference to the component, and that's why nothing shows up.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Solution
&lt;/h3&gt;

&lt;p&gt;To fix this, you need to &lt;strong&gt;render the component&lt;/strong&gt; inside your JSX.&lt;/p&gt;

&lt;p&gt;Let’s say you have a &lt;code&gt;services&lt;/code&gt; array where you store the icons and other information like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;services&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Frontend Development&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FaCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// The icon reference&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I create responsive websites...&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="c1"&gt;// More services...&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when you map through your &lt;code&gt;services&lt;/code&gt; and want to display the icons, you need to &lt;strong&gt;render the icon as a component&lt;/strong&gt;. Here’s how you do it:&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;{&lt;/span&gt;&lt;span class="nx"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;service&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&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;span&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;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nt"&gt;icon&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* This is how you render the icon */&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;span&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;h3&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&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;h3&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;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how we used &lt;code&gt;&amp;lt;service.icon /&amp;gt;&lt;/code&gt;? This tells React to &lt;strong&gt;render the icon&lt;/strong&gt; like a normal component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Works
&lt;/h3&gt;

&lt;p&gt;In React, to display a component (like &lt;code&gt;FaCode&lt;/code&gt;), you need to treat it like a &lt;strong&gt;JSX element&lt;/strong&gt;, meaning you write it as &lt;code&gt;&amp;lt;Component /&amp;gt;&lt;/code&gt;. By doing this, React knows you want it to show up in your UI.&lt;/p&gt;

&lt;p&gt;So, instead of just passing &lt;code&gt;FaCode&lt;/code&gt;, you're now telling React to &lt;strong&gt;actually render the icon&lt;/strong&gt; by using the correct JSX syntax.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;If your icons aren’t showing up in React, just remember to use the &lt;strong&gt;JSX component syntax&lt;/strong&gt; when you’re rendering them. Instead of passing the icon component reference, call it like this:&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="nt"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nt"&gt;icon&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;Now your icons should display perfectly! 🎉&lt;/p&gt;

&lt;p&gt;I hope this helps you solve the issue. If you have any more questions or run into other problems, feel free to leave a comment or reach out. Happy coding! 💻&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering React Forms with a State Object: My Personal Experience</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Tue, 08 Apr 2025 06:29:27 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/mastering-react-forms-with-a-state-object-my-personal-experience-3a69</link>
      <guid>https://dev.to/theolukayodeasemudara/mastering-react-forms-with-a-state-object-my-personal-experience-3a69</guid>
      <description>&lt;p&gt;As a frontend developer constantly learning and building, one of my recent tasks was to create a form in React where multiple input fields were all tied to a single state object. Simple in theory, but I discovered a few powerful patterns that made the process clean, scalable, and easy to manage — and I’d love to share my experience here.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Challenge&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I needed to build a “Create New Post” form with fields like title, date, time, content, and even an image. Rather than manage each input with its own state, I decided to keep things tidy by using one &lt;code&gt;useState&lt;/code&gt; hook with an object like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;newPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setNewPost&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="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;image&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But then came the question: &lt;em&gt;How do I update individual fields in this object when users type into the form?&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Pattern That Changed Everything&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Instead of writing separate functions for each input, I used an inline &lt;code&gt;onChange&lt;/code&gt; handler that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nf"&gt;setNewPost&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;newPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&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;At first glance, it felt a little complex — but once I understood it, it became second nature.&lt;/p&gt;

&lt;p&gt;Here’s the breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;e.target.name&lt;/code&gt; is the name of the input (like "title").&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;e.target.value&lt;/code&gt; is the value typed in.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[e.target.name]: e.target.value&lt;/code&gt; dynamically updates the correct field in the &lt;code&gt;newPost&lt;/code&gt; object.&lt;/li&gt;
&lt;li&gt;The spread operator &lt;code&gt;...newPost&lt;/code&gt; ensures all other values in the object stay unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This pattern made the form feel way more dynamic and scalable. I could add more fields without needing to touch the &lt;code&gt;onChange&lt;/code&gt; logic again. And that’s exactly the kind of flexibility I love as a developer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus: File Uploads&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The only difference was with the image input. File inputs use &lt;code&gt;e.target.files[0]&lt;/code&gt; instead of &lt;code&gt;e.target.value&lt;/code&gt;, so I updated that one like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nf"&gt;setNewPost&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;newPost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;My Key Takeaway&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Learning this pattern helped me write cleaner React forms and gave me a better grasp of how state management really works under the hood. It’s one of those small wins that makes a big difference in bigger projects.&lt;/p&gt;

&lt;p&gt;If you're just getting started with React forms, I highly recommend this method. It keeps things neat, avoids repetition, and scales beautifully as your form grows.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Technical Article about front-end technologies.</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Fri, 28 Jun 2024 20:14:45 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/a-technical-article-about-front-end-technologies-4dh6</link>
      <guid>https://dev.to/theolukayodeasemudara/a-technical-article-about-front-end-technologies-4dh6</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;In the ever-evolving landscape of web development, frontend technologies have seen a dramatic transformation over the past few decades. From the static web pages of the early internet to the dynamic, interactive, and highly responsive applications we use today, frontend technologies have played a crucial role in shaping user experiences. This article takes you through the journey of frontend technologies, highlighting key milestones and the modern tools that are driving innovation in the field.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Early Days: HTML, CSS, and JavaScript
&lt;/h4&gt;

&lt;p&gt;The Foundation HyperText Markup Language (HTML) is the backbone of the web, providing the structure for web pages. Despite its simplicity, HTML laid the groundwork for the web as we know it today.&lt;/p&gt;

&lt;p&gt;CSS: Styling the Web. CSS allowed developers to separate content from design, making it easier to maintain and update the look and feel of websites. With CSS, developers could control layout, colors, fonts, and more, bringing a more polished and visually appealing experience to users.&lt;/p&gt;

&lt;h5&gt;
  
  
  JavaScript: Bringing Interactivity
&lt;/h5&gt;

&lt;p&gt;JavaScript, revolutionized the web by enabling interactive features. Unlike HTML and CSS, JavaScript is a programming language that runs in the browser, allowing developers to create dynamic content that responds to user actions. From form validation to interactive maps, JavaScript opened up a world of possibilities for web developers.&lt;/p&gt;

&lt;p&gt;The Rise of Libraries and Frameworks&lt;/p&gt;

&lt;p&gt;React: The Component Revolution&lt;br&gt;
Facebook's React, introduced in 2013, brought a revolutionary approach with its component-based architecture. React components encapsulate their logic and presentation, making it easier to manage and reuse code. &lt;/p&gt;

&lt;p&gt;Vue.js: The Progressive Framework&lt;br&gt;
Vue.js, created by Evan You in 2014, combined the best of AngularJS and React. Vue is known for its simplicity and flexibility, making it approachable for beginners who probably just decided to move from writing pure javascript to delve into a new javascript framework. Unlike React, Vue is quite very easy for beginners because it uses almost same code-block like pure javascript and still very powerful enough for large-scale applications. Vue's reactive data binding and component-based architecture have made it a favorite among developers plus me in particular. Especially when you are moving from vue to Nuxt which is still Vue but unlike Vue, where you have to import a number of components, Nuxt auto imports these components anytime that you need to use them in a certain code-block.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;As much as I am aware that HNG is a React only based Internship which means that I would either have to learn to use react or possibly be evicted out of the race along the line. I would still love to go ahead if given the opportunity to learn alongside others using Vue/Nuxt, if otherwise, I would continue to learn React till I finish or till I am dropped out of the race.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://hng.tech/internship" rel="noopener noreferrer"&gt;HNG Internships&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hng.tech/premium" rel="noopener noreferrer"&gt;HNG Internships&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Programmatically displaying nav menu from an array and binding to its url property</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Mon, 04 Mar 2024 07:51:02 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/programmatically-displaying-nav-menu-from-an-array-and-binding-to-its-url-property-2nhl</link>
      <guid>https://dev.to/theolukayodeasemudara/programmatically-displaying-nav-menu-from-an-array-and-binding-to-its-url-property-2nhl</guid>
      <description>&lt;p&gt;Summary:&lt;br&gt;
In a recent Vue.js/Nuxt.js project, the initial challenge I encountered was with the navigation menu links not functioning correctly despite being correctly bound. After thorough debugging and troubleshooting, I successfully resolved the issue with the following steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Correct Binding of Route Paths:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## First error&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;li v-for="link in links" :key="link"&amp;gt;
            &amp;lt;NuxtLink :to="url"&amp;gt;{{ link.text }}&amp;lt;/NuxtLink&amp;gt;
          &amp;lt;/li&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;links: [
        { text: "About", url: "/about" },
        { text: "Portfolio", url: "/" },
        { text: "Blog", url: "/blog" },
      ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;## Corrected code;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;li v-for="link in links" :key="link.url"&amp;gt;
            &amp;lt;NuxtLink :to="link.url"&amp;gt;{{ link.text }}&amp;lt;/NuxtLink&amp;gt;
          &amp;lt;/li&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;links: [
        { text: "About", url: "/about" },
        { text: "Portfolio", url: "/" },
        { text: "Blog", url: "/blog" },
      ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure that the to attribute in NuxtLink components is correctly bound to the route paths using :to="link.url".&lt;br&gt;
Verify that the links array contains objects with text and url properties representing the route paths.&lt;br&gt;
Iterating Over Links Array:&lt;/p&gt;

&lt;p&gt;Use v-for directive to iterate over the links array and generate NuxtLink components dynamically.&lt;br&gt;
Each link object should have text representing the link text and url representing the route path.&lt;br&gt;
Testing and Debugging:&lt;/p&gt;

&lt;p&gt;Test the navigation menu on different devices and screen sizes to ensure links are clickable and functional.&lt;br&gt;
Utilize browser developer tools to inspect elements and debug any JavaScript errors or CSS issues affecting link functionality.&lt;br&gt;
By addressing the initial challenge and ensuring correct binding of route paths, the issue with links not working in the Vue.js/Nuxt.js navigation menu was successfully resolved. This approach ensures a smooth and seamless user experience for navigating through the website.&lt;/p&gt;

&lt;p&gt;Feel free to incorporate these steps into your Vue.js/Nuxt.js projects to troubleshoot and resolve similar issues with navigation menus. Happy coding!&lt;/p&gt;

</description>
      <category>design</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Slots VS Props in NUXT-3</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Sun, 03 Mar 2024 15:58:23 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/slots-vs-props-in-nuxt-3-34h8</link>
      <guid>https://dev.to/theolukayodeasemudara/slots-vs-props-in-nuxt-3-34h8</guid>
      <description>&lt;p&gt;In Nuxt 3, "slots" and "props" serve different purposes in the context of components.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Slots:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Slots allow you to pass content from a parent component to a child component. They are useful when you want to create reusable components that can accept different content depending on where they are used.&lt;/li&gt;
&lt;li&gt;In Nuxt 3, slots are defined in the child component using &lt;code&gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/code&gt; tags. The content provided by the parent component is then inserted into these slots.&lt;/li&gt;
&lt;li&gt;Slots provide flexibility and reusability by allowing the parent component to inject content into specific areas of the child component's template.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&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="c"&gt;&amp;lt;!-- ChildComponent.vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Child Component&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- Content from parent component will be inserted here --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ParentComponent.vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Parent Component&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ChildComponent&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!-- Content passed to ChildComponent's slot --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This content will be placed inside the ChildComponent.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ChildComponent&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Props:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Props are custom attributes that you can define on a component to pass data from a parent component to a child component.&lt;/li&gt;
&lt;li&gt;They allow you to make your components dynamic by passing data dynamically to them.&lt;/li&gt;
&lt;li&gt;In Nuxt 3, props are defined in the child component's script section and can be used inside the component's template.&lt;/li&gt;
&lt;li&gt;Props are useful when you need to pass specific data or configurations to a component.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&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="c"&gt;&amp;lt;!-- ChildComponent.vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ title }}&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;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="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;required&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="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- ParentComponent.vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Parent Component&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ChildComponent&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Dynamic Title"&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;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In summary, while slots are used for passing content from parent to child components, props are used for passing data or configurations from parent to child components in Nuxt 3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt; Anytime, anyday..I'd prefer to use SLOTS instead of PROPS. Slots come in very handy and you have easier control of your DOM than when you use props.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Your first Nuxt-3 App</title>
      <dc:creator>Olukayode Asemudara</dc:creator>
      <pubDate>Sun, 03 Mar 2024 14:16:19 +0000</pubDate>
      <link>https://dev.to/theolukayodeasemudara/your-first-nuxt-3-app-22c</link>
      <guid>https://dev.to/theolukayodeasemudara/your-first-nuxt-3-app-22c</guid>
      <description>&lt;p&gt;Prerequisites for installing Nuxt-3 on your device;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Node.js - v18.0.0 or newer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Text editor - We recommend Visual Studio Code with the Volar Extension&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Terminal - In order to run Nuxt commands&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now go to the nuxt website to get started with setting up your nuxt app. Click on the get started button and follow these prompts;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;npx nuxi@latest init  (Open a terminal (if you're using Visual Studio Code, you can open an integrated terminal) and use the following command to create a new starter project:).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;code . (Open your project folder in Visual Studio Code:)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cd  (Or change directory into your new project from your terminal:)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;npm install (Install the dependencies:)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;npm run dev (Now you'll be able to start your Nuxt app in development mode:)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Well done! A browser window should automatically open for &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
