<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Blake Yeboah's Blog]]></title><description><![CDATA[I write articles about React, JavaScript & Web Development to make your learning journey easier 😀]]></description><link>https://blog.blakeyeboah.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1646636334419/PGx_pFMJW.png</url><title>Blake Yeboah&apos;s Blog</title><link>https://blog.blakeyeboah.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 23:34:14 GMT</lastBuildDate><atom:link href="https://blog.blakeyeboah.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Optimizing Website Performance for Speed and User Experience]]></title><description><![CDATA[Introduction
Website performance is an important aspect of web development.
It consists of mainly two things:

The speed of your website

How usable is your website for visitors?


Importance of website performance
Website performance is very importa...]]></description><link>https://blog.blakeyeboah.com/optimizing-website-performance-for-speed-and-user-experience</link><guid isPermaLink="true">https://blog.blakeyeboah.com/optimizing-website-performance-for-speed-and-user-experience</guid><category><![CDATA[Web Development]]></category><category><![CDATA[performance]]></category><category><![CDATA[webdev]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Mon, 06 May 2024 11:16:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1714896127046/fb7a5536-febc-4bce-a2cd-783abd7d0fe5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Website performance is an important aspect of web development.</p>
<p>It consists of mainly two things:</p>
<ul>
<li><p>The speed of your website</p>
</li>
<li><p>How usable is your website for visitors?</p>
</li>
</ul>
<h3 id="heading-importance-of-website-performance">Importance of website performance</h3>
<p>Website performance is very important to consider when building new websites.</p>
<p>If it's an e-commerce store, it can have a large impact on your user's conversion rate.</p>
<p>If it's a lead generation website, it can have an impact on how many users become leads.</p>
<p>If it's a blog, people are more likely to be engaged in your content if the speed is good.</p>
<p>Website performance is also a factor in SEO, so a faster website will rank higher.</p>
<h3 id="heading-impact-of-speed-on-user-experience">Impact of speed on user experience</h3>
<p>Speed has a significant impact on user experience.</p>
<p>Slower websites leave a poor impression on users and make them more likely to leave.</p>
<p>Think of trying to navigate through a website, and pages take 10+ seconds to load...</p>
<p>You're very likely to leave, aren't you?</p>
<p>Now that we've established why good website performance is vital for modern websites, let's dive deeper into what affects a website's speed.</p>
<h2 id="heading-understanding-website-performance">Understanding website performance</h2>
<h3 id="heading-factors-affecting-website-speed">Factors affecting website speed</h3>
<p>There are plenty of factors that impact website speed, including, but not limited to:</p>
<ul>
<li><p>The size of images</p>
</li>
<li><p>The number of requests made</p>
</li>
<li><p>The server response time</p>
</li>
<li><p>The size of the files requested</p>
</li>
<li><p>Third-party scripts</p>
</li>
</ul>
<p>At the end of the day, the more a browser has to do to render your website (<em>like importing scripts, fetching images, etc.</em>), the slower it will be.</p>
<h3 id="heading-metrics-to-measure-website-performance">Metrics to measure website performance</h3>
<p>There are numerous metrics to take into account when measuring website performance.</p>
<p>Using a tool like Google's <a target="_blank" href="https://pagespeed.web.dev/">PageSpeed Insights</a>, you can get valuable metrics to boost performance. These include:</p>
<ul>
<li><p><strong>First contentful paint (FCP):</strong> marks the first point in the page load timeline where the user can see anything on the screen.</p>
</li>
<li><p><strong>Largest Contentful Paint (LCP):</strong> marks the point in the page load timeline when the page's main content has likely loaded.</p>
</li>
<li><p><strong>Total blocking time:</strong> measures the total time after FCP where the main thread was blocked for long enough to prevent responses to user input.</p>
</li>
<li><p><strong>Cumulative layout shift:</strong> a measure of the largest burst of layout shift scores for every unexpected layout shift that occurs during the lifespan of a page.</p>
</li>
</ul>
<p>All of these metrics are crucial to review to improve website performance.</p>
<h2 id="heading-strategies-to-optimize-website-performance">Strategies to optimize website performance</h2>
<p>To effectively optimize website performance, the exact strategies vary based on the website.</p>
<p>A wide range of factors (as discussed previously) play a role in website performance.</p>
<p>Depending on the website, some areas are probably doing well, but others need to be focused on.</p>
<p>Fortunately, a tool like PageSpeed Insights provides actionable, specific opportunities to improve website performance.</p>
<p>Let's talk about a few common strategies that will improve web performance.</p>
<h3 id="heading-minifying-css-javascript-and-html">Minifying CSS, JavaScript, and HTML</h3>
<p>Minifying CSS, JavaScript, and HTML is a simple and effective strategy to improve performance.</p>
<p>Compressing these files will improve your website's load time since it takes less time to download a smaller file.</p>
<p>So when a user's browser fetches your website, it fetches smaller payloads.</p>
<p>How this strategy can be implemented depends on the website.</p>
<p>For CMS-based platforms, there are typical plugins that can handle this.</p>
<p>For custom applications, this can be done through an NPM package or, in some cases, manually.</p>
<p>Minifying CSS, JS, and HTML can't negatively impact performance, so I recommend everyone implement this in some capacity.</p>
<h3 id="heading-optimizing-images-and-videos">Optimizing images and videos</h3>
<p>Optimizing images and videos is another strategy to improve website performance.</p>
<p>Unoptimized images and videos can have a significant impact on how fast a website loads.</p>
<p>All images should be compressed and served in a smaller, faster format, like.webp.</p>
<p>Additionally, images that aren't shown right away should be lazy-loaded. This means they are loaded only when the user sees them, rather than on load, so the page's initial load time is faster.</p>
<p>This can be done by adding the <code>loading="lazy"</code> attribute to images.</p>
<p>Videos should also be compressed and preferably deferred from loading to improve the initial load time.</p>
<h3 id="heading-implementing-browser-caching">Implementing browser caching</h3>
<p>Browser caching is another effective strategy for improving website performance.</p>
<p>Static files like and.js can be cached, so they don't need to be fetched again every time a user loads your website.</p>
<p>You may have noticed this when you revisit a website and it loads significantly faster than the first time you loaded the website.</p>
<p>Implementing this strategy varies based on how the website is built and how it is hosted.</p>
<h3 id="heading-utilizing-content-delivery-networks-cdn">Utilizing Content Delivery Networks (CDN)</h3>
<p>A content delivery network is, in essence, a way of delivering content to your users by placing caching servers across the globe.</p>
<p>A CDN is designed to reduce the distance (virtually) between the browser and the server.</p>
<p>This means files are delivered faster, leading to a faster website.</p>
<p>CDNs integrate with web hosting providers to deliver faster website performance with ease.</p>
<h3 id="heading-reducing-server-response-time">Reducing server response time</h3>
<p>Reducing server response time is another strategy that can boost website performance.</p>
<p>The initial server response time is a crucial part of website performance.</p>
<p>A slow response time means a slow website.</p>
<p>While most of the response time has to do with the exact setup and hosting provider, here are some general tips to improve performance:</p>
<ul>
<li><p>Use well-optimized plugins (particularly those relevant to platforms like Wordpress).</p>
</li>
<li><p>Choose a popular, trusted hosting provider.</p>
</li>
<li><p>Optimize your database.</p>
</li>
<li><p>Reduce resource sizes</p>
</li>
</ul>
<p>That covers website speed; let's move on to enhancing the user experience.</p>
<h2 id="heading-enhancing-the-user-experience">Enhancing the user experience</h2>
<p>User experience (UX) is another crucial aspect of website performance.</p>
<p>UX is essentially how usable a website is for the end user.</p>
<p>UX is a wide topic, but let's talk about a few key areas where websites often get wrong.</p>
<h3 id="heading-improving-website-navigation">Improving website navigation</h3>
<p>The purpose of website navigation is for users to be able to navigate a website and find the information they are looking for.</p>
<p>Website navigation should be simple.</p>
<p>It should not be difficult for a visitor to find what they are looking for.</p>
<p>On desktop, links should be shown right away and not hidden in a sidebar behind a hamburger icon.</p>
<p>On mobile, the navigation bar should be small so it does not take up too much screen real estate and take away from the content.</p>
<p>Furthermore, the navigation bar should be sticky to improve the user experience so they don't need to scroll back to the top of the page.</p>
<p>These are some general tips on improving website navigation; however, they vary based on the purpose of the website as well as the specific niche.</p>
<p>Looking at similar websites can help determine what works best.</p>
<h3 id="heading-implementing-responsive-design">Implementing responsive design</h3>
<p>A responsive design is a must-have for websites in 2024 and beyond.</p>
<p>Responsive, essentially, means the website adapts to the user's screen size and shows the content appropriately.</p>
<p>This means the website should look good on computers, laptops, tablets, mobile phones, etc.</p>
<p>Responsive design is crucial for UX, as if elements don't function properly or overflow off the screen, it makes it much harder for users to use the website.</p>
<p>If the website is custom-made, it can be responded to through CSS media queries.</p>
<p>If the website is built on a CMS like WordPress, it's important to choose a responsive theme that works well in your niche.</p>
<h3 id="heading-minimizing-pop-ups-and-ads">Minimizing pop-ups and ads</h3>
<p>For superior UX, it's best to minimize pop-ups and advertisements that show up.</p>
<p>Using popups for users to complete actions like creating an account is fine, of course.</p>
<p>But having popups that show at random intervals with content that may not be relevant for the user can be very distracting and cause users to leave.</p>
<p>Additionally, too many advertisements on a page will also frustrate users, potentially causing them to leave.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Website performance is crucial for the user experience and SEO. Factors like speed, image size, server response time, and third-party scripts impact performance. Metrics like FCP, LCP, and total blocking time are key.</p>
<p>Strategies to improve performance include minifying CSS/JS/HTML, optimizing images/videos, browser caching, CDN use, and reducing server response time.</p>
<p>Enhancing the user experience involves improving navigation, implementing responsive design, and minimizing pop-ups and ads. Continuous optimization is essential for website success.</p>
<h3 id="heading-importance-of-continuous-optimization-for-website-performance-and-user-experience">Importance of continuous optimization for website performance and user experience.</h3>
<p>Continuous optimization is crucial for website performance and the user experience, as things change over time.</p>
<p>User experience is largely about learning what your end user's key goal is and how you can best optimize your website for them to achieve that goal.</p>
<p>👌 Thanks for reading this article!</p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
]]></content:encoded></item><item><title><![CDATA[Useful Web APIs For Your Next Project]]></title><description><![CDATA[There are plenty of native web APIs that have a variety of uses.
Here are 5 useful APIs that I use quite often in my web development projects.
Clipboard API
The clipboard API is a simple method to copy text to a user's clipboard.
This can be used in ...]]></description><link>https://blog.blakeyeboah.com/useful-web-apis-for-your-next-project</link><guid isPermaLink="true">https://blog.blakeyeboah.com/useful-web-apis-for-your-next-project</guid><category><![CDATA[Web Development]]></category><category><![CDATA[APIs]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Sun, 05 May 2024 07:54:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1714544954472/ee083ec7-1642-4769-a373-683ad448ff50.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are plenty of native web APIs that have a variety of uses.</p>
<p>Here are 5 useful APIs that I use quite often in my web development projects.</p>
<h3 id="heading-clipboard-api">Clipboard API</h3>
<p>The clipboard API is a simple method to copy text to a user's clipboard.</p>
<p>This can be used in a wide range of applications such as URL shorteners or blogs, where you want to add a copy button to copy content.</p>
<p>To copy text, you first need an element on the DOM with the text:</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"Text to be copied"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"copy-text"</span>&gt;</span>
</code></pre>
<p>Now, we can write a quick JavaScript function to copy this text:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> writeToClipboard = <span class="hljs-function">() =&gt;</span> {
   <span class="hljs-keyword">const</span> textToBeCopied = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"copy-text"</span>);
   textToBeCopied.select();
   textToBeCopied.setSelectionRange(<span class="hljs-number">0</span>, <span class="hljs-number">99999</span>);
   navigator.clipboard.writeText(textToBeCopied.value);
}
</code></pre>
<p>This function can be called however you'd like, such as on click of a copy button.</p>
<h3 id="heading-localstorage-api">LocalStorage API</h3>
<p>LocalStorage provides a simple interface for storing data locally in your user's browser.</p>
<p>Its very similar to session storage and cookies, with the key difference that is does not expire.</p>
<p>There are three main methods you can use.</p>
<p>To store data, you can use <code>.setItem()</code></p>
<pre><code class="lang-javascript"><span class="hljs-built_in">localStorage</span>.setItem(<span class="hljs-string">'key'</span>, <span class="hljs-string">'value'</span>);
</code></pre>
<p>Items are stored as key/value pairs in localStorage.</p>
<p>To retrieve an item from localStorage, you can use <code>.getItem()</code></p>
<pre><code class="lang-javascript"><span class="hljs-built_in">localStorage</span>.getItem(<span class="hljs-string">'key'</span>);
</code></pre>
<p>Lastly, to remove an item from localStorage, you can use <code>.removeItem()</code></p>
<pre><code class="lang-javascript"><span class="hljs-built_in">localStorage</span>.removeItem(<span class="hljs-string">'key'</span>);
</code></pre>
<p>Items are stored as strings in localStorage, so to store an object or array, you need to use the <code>JSON.stringify()</code> method.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> people = [<span class="hljs-string">'Blake'</span>, <span class="hljs-string">'John'</span>, <span class="hljs-string">'Jane'</span>];
<span class="hljs-built_in">localStorage</span>.setItem(<span class="hljs-string">'people'</span>, <span class="hljs-built_in">JSON</span>.stringfy(people));
</code></pre>
<p>Then when we get the item, we can use <code>JSON.parse()</code> to convert it back to an array.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> people = <span class="hljs-built_in">JSON</span>.parse(<span class="hljs-built_in">localStorage</span>.getItem(<span class="hljs-string">'people'</span>));
</code></pre>
<p>That sums up localStorage, now lets move on to the Geolocation API.</p>
<h3 id="heading-geolocation-api">Geolocation API</h3>
<p>The Geolocation API is a simple interface to get the user's location.</p>
<p>This can be used to personalize your website to your users.</p>
<p>For example, you could add a nearby stores section or show deals available for the user's specific location.</p>
<p>To get the users location, you can use the <code>getCurrentPosition()</code> method.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">if</span> (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(<span class="hljs-function">(<span class="hljs-params">position</span>) =&gt;</span> {
        <span class="hljs-built_in">console</span>.log(position);
    });
}
</code></pre>
<p><code>position</code> is a object with the user's coordinates as well as timestamp.</p>
<h3 id="heading-history-api">History API</h3>
<p>The history API allows you to navigate the user back and forward among pages.</p>
<p>For example, to simulate the user clicking the back button:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">window</span>.history.back()
</code></pre>
<p>And the forward button:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">window</span>.history.forward()
</code></pre>
<p>Yes, its that simple.</p>
<h3 id="heading-fetch-api">Fetch API</h3>
<p>The fetch API is a interface for making HTTP requests.</p>
<p>It cna be used as an alternative to packages like axios or built-in methods like <code>XMLHttpRequest</code></p>
<p>To make a GET request:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">makeRequest</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'request url...'</span>);
    <span class="hljs-keyword">const</span> json = <span class="hljs-keyword">await</span> response.json();
    <span class="hljs-built_in">console</span>.log(json);
}
</code></pre>
<p>To make a POST request:</p>
<pre><code class="lang-javascript">fetch(<span class="hljs-string">'request url...'</span>, {
      <span class="hljs-attr">method</span>: <span class="hljs-string">"POST"</span>,
      <span class="hljs-attr">headers</span>: {
        <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
      },
      <span class="hljs-attr">body</span>: <span class="hljs-built_in">JSON</span>.stringify(data),
    });
</code></pre>
<p>I have another article all about the Fetch API that dives into deeper detail.</p>
<p>Check it out <a target="_blank" href="https://blog.blakeyeboah.com/how-to-use-the-fetch-api-in-javascript">here</a> if you're interested.</p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>We have covered 5 useful native web APIs discussed in this article: Clipboard API for copying text, LocalStorage API for storing data, Geolocation API for getting user's location, History API for navigating pages, and Fetch API for making HTTP requests.</p>
<p>Each API is explained with examples and usage instructions.</p>
<p>👌 Thanks for reading this article!</p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
]]></content:encoded></item><item><title><![CDATA[How to use the Fetch API in JavaScript]]></title><description><![CDATA[Hey All 👋
In this article, we'll be covering the Fetch API in JavaScript how you can use it to make HTTP requests.
What is the Fetch API?
The fetch() method provides a simple way to make HTTP requests in JavaScript.
It is natively in the browser, me...]]></description><link>https://blog.blakeyeboah.com/how-to-use-the-fetch-api-in-javascript</link><guid isPermaLink="true">https://blog.blakeyeboah.com/how-to-use-the-fetch-api-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[APIs]]></category><category><![CDATA[fetch API]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Sat, 04 May 2024 08:32:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1714456484651/608568fb-d901-48d5-9787-a94f2bd86198.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-hey-all">Hey All 👋</h2>
<p>In this article, we'll be covering the Fetch API in JavaScript how you can use it to make HTTP requests.</p>
<h2 id="heading-what-is-the-fetch-api">What is the Fetch API?</h2>
<p>The fetch() method provides a simple way to make HTTP requests in JavaScript.</p>
<p>It is natively in the browser, meaning you don't have to import an additional module (like axios).</p>
<p>Additionally, its asynchronous and promise-based which makes catching errors and handling responses easy.</p>
<h2 id="heading-using-the-fetch-api">Using the Fetch API</h2>
<p>The syntax is very simple, you just have to use the <code>fetch()</code> method</p>
<p>Making a GET request is very simple:</p>
<p><code>fetch('request url')</code></p>
<p><em>Replace request url with the URL you want tor request.</em></p>
<p>The fetch method returns a promise, which means there are two ways you can handle the response.</p>
<h3 id="heading-using-then-syntax">Using <code>.then</code> Syntax</h3>
<pre><code class="lang-javascript">fetch(<span class="hljs-string">'request url...'</span>)
      .then(<span class="hljs-function"><span class="hljs-params">response</span> =&gt;</span> response.json())
      .then(<span class="hljs-function"><span class="hljs-params">json</span> =&gt;</span> <span class="hljs-built_in">console</span>.log(json))
      .catch(<span class="hljs-function"><span class="hljs-params">error</span> =&gt;</span> <span class="hljs-built_in">console</span>.error(error));
</code></pre>
<h3 id="heading-using-asyncawait">Using <code>async/await</code></h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">makeRequest</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'request url...'</span>);
    <span class="hljs-keyword">const</span> json = <span class="hljs-keyword">await</span> response.json();
    <span class="hljs-built_in">console</span>.log(json);
}
</code></pre>
<p>We can improve the <code>async/await</code> further by wrapping it in a <code>try/catch</code> statement to catch an error:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">makeRequest</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">try</span> {
        <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'request url...'</span>);
        <span class="hljs-keyword">const</span> json = <span class="hljs-keyword">await</span> response.json();
        <span class="hljs-built_in">console</span>.log(json);
    } <span class="hljs-keyword">catch</span> (error) {
        <span class="hljs-built_in">console</span>.error(error)
    }
}
</code></pre>
<h3 id="heading-additional-options">Additional Options</h3>
<p>You can add options to the request by adding a second parameter.</p>
<p>This allows you to add headers, change the request type, and more.</p>
<p>For example, to make a post request:</p>
<pre><code class="lang-javascript">fetch(<span class="hljs-string">"https://example.com/profile"</span>, {
      <span class="hljs-attr">method</span>: <span class="hljs-string">"POST"</span>,
      <span class="hljs-attr">headers</span>: {
        <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
      },
      <span class="hljs-attr">body</span>: <span class="hljs-built_in">JSON</span>.stringify(data),
    });
</code></pre>
<p>The <code>method</code> can be set as any HTTP Request method like GET, POST, PUT, DELETE, etc.</p>
<p>The <code>headers</code> object is used to control the headers of the request.</p>
<p>This could be used for authenticating requests, changing the content type (like in the request above), or other headers you want to include.</p>
<p>The <code>body</code> is the request's body.</p>
<h2 id="heading-wrapping-up">Wrapping up</h2>
<p>That is a overview of how the Fetch API works in JavaScript.</p>
<p>It can used as an alternative to popular packages like axios, as well as built in methods like <code>XMLHttpRequest</code></p>
<p>👌 Thanks for reading this article!</p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
]]></content:encoded></item><item><title><![CDATA[Don't Make These Common Mistakes While Learning To Code]]></title><description><![CDATA[Hey All 👋
In this article, we'll be covering 4 mistakes commonly made by people while learning to code that will seriously impact their coding journey.
#1 - Copying and Pasting
The first mistake I'll talk about is copying and pasting. 
We've all don...]]></description><link>https://blog.blakeyeboah.com/dont-make-these-common-mistakes-while-learning-to-code</link><guid isPermaLink="true">https://blog.blakeyeboah.com/dont-make-these-common-mistakes-while-learning-to-code</guid><category><![CDATA[learning]]></category><category><![CDATA[Learning Journey]]></category><category><![CDATA[learn coding]]></category><category><![CDATA[coding]]></category><category><![CDATA[Programming Tips]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 11 Aug 2022 12:36:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1658135025285/oZ6_tQgAq.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-hey-all">Hey All 👋</h2>
<p>In this article, we'll be covering 4 mistakes commonly made by people while learning to code that will seriously impact their coding journey.</p>
<h2 id="heading-1-copying-and-pasting">#1 - Copying and Pasting</h2>
<p>The first mistake I'll talk about is copying and pasting. </p>
<p>We've all done it. Don't deny it 😉</p>
<p>There's nothing inherently wrong with copying and pasting code, as long as you understand how the code works to achieve what it does. While learning to code, its crucial that every piece of code you write, you understand how it works. </p>
<p>Otherwise, you're not really learning anything.</p>
<p>If you simply copy and paste a bunch of code from stack overflow to create a cool application, well done, you've created a cool application.</p>
<p>However, you don't understand how it works and haven't learned anything. You haven't progressed as a developer. If asked to speak through your code (e.g in an interview), you won't even know where to start.</p>
<p>It's very important that any code you copy from the internet, you should understand what every part does and be able to explain it to someone else (this really demonstrates your understanding).</p>
<h2 id="heading-2-getting-stuck-in-tutorial-hell">#2 - Getting Stuck In Tutorial Hell</h2>
<p>Tutorial Hell! We've all heard of it. But what actually is it? (you might be stuck in it and not even realize it 😬)</p>
<p>Tutorial Hell is essentially where you are stuck in a state of watching plenty of tutorials. These could be on building projects, or just learning a new language/framework. But you aren't moving forward, since you keep simply re-creating the projects in the tutorial and following the exact instructions throughout without actually retrieving the knowledge and trying to apply it to your own projects.</p>
<p>The easiest way to get out of tutorial hell, is to simply think of  project that is slightly more complicated than anything you have built. Then, using the knowledge you've learned, go out and try to build it.</p>
<p>Will you get stuck? Probably, but that's a good thing.</p>
<p>You'll learn how to solve problems and how to actually progress and apply your knowledge rather than just replicating code on a screen.</p>
<p>To put this into an example, so you can hopefully understand what I'm trying to say:</p>
<ul>
<li>Lets say you watched a tutorial on how to build a to-do list in React and then you went out and built a to-do list by following the tutorial.</li>
</ul>
<p>This is a fine first step, but next, to apply the knowledge you've just learned and progress further as a developer you could:</p>
<ul>
<li>Build an expense tracker</li>
</ul>
<p>An expense tracker is a completely different application than a todo list. However, when you break it down, it essentially requires very similar skills to building a todo list.</p>
<p>It requires handling state, handling user input, rendering state to the DOM exactly what building a todo list teaches you.</p>
<p>You may be thinking since it requires similar skills as a todo list that you won't learn anything by building it?</p>
<p>But, what you're not considering is how much you learn by going out and building an application without blindly following  a tutorial and typing code. </p>
<p>You get used to getting stuck and figuring out how to solve the problem.</p>
<p>You get used to reading documentation and coming up with code on your own.</p>
<p>You will start to learn how the concepts you've learned in the tutorial can be applied to a range of other projects you may be interested in building.</p>
<p>Getting out of tutorial hell can be challenging, but as long as you aren't afraid of a challenge and your desire to become a developer outweighs your fear of failure, I'm sure you'll be fine.</p>
<h2 id="heading-3-trying-to-learn-too-much-at-once">#3 - Trying to Learn Too Much At Once</h2>
<p>This mistake is very common. I see it all the time and am guilty of it myself. </p>
<p>When you are learning something new, its very important to learn one new technology at a time.</p>
<p><strong>Imagine this:</strong></p>
<p>You want to learn React but you don't know JavaScript. So you decide to learn both React and JavaScript at the same time.</p>
<p>This is a terrible idea because while learning "React" you are writing JavaScript that you don't even understand. You will have no idea whether what you're learning is a part of JavaScript or a part of the React library.</p>
<p>If you proceeded with this approach until you felt as though you have learned both, you may know React and be able to build projects with it. However, if someone asked you to build a todo list with vanilla JavaScript, you wouldn't know where to start. </p>
<p><em>Is JSX a part of JavaScript?</em></p>
<p><em>Can't I just create a Todo component in JavaScript?</em></p>
<p><em>How can I manipulate the DOM with JavaScript?</em></p>
<p>You see my point? Learning multiple things at once, especially interconnected things like JS and React, won't properly teach you either and you will have a much harder time learning later on since you will contradicting knowledge you thought you knew.</p>
<p>Another reason why you shouldn't try learning too much at once is because of how our brains work. We simply cannot absorb too much information at once. </p>
<p>Have you ever spent many hours learning something and then a few days later completely forget it?</p>
<p>This is just how our brain works. We need to take in information gradually and slowly build up our knowledge base.</p>
<p>My advice would be to:</p>
<ul>
<li>Be patient, enjoy the learning process</li>
<li>Take time to learn technologies properly and understand them deeply</li>
<li>Don't try learning multiple technologies at once </li>
</ul>
<h2 id="heading-4-skipping-the-fundamentals">#4 - Skipping The Fundamentals</h2>
<p>Its very crucial that you learn the fundamentals of each language or framework you're learning. It can be very easy to skip over the basics and go into the more interesting and advanced concepts. However, you should always take your time to learn the fundmentals.</p>
<p>If you're learning a new language, don't skip over the basics like:</p>
<ul>
<li>Defining variables</li>
<li>Creating and running functions</li>
<li>Defining and using types (not always applicable)</li>
<li>Printing text to the console/browser</li>
<li>Writing comments</li>
<li>etc</li>
</ul>
<p>The fundamentals may be boring and easy, but in the end of the day, you have to lay the foundation before you build the house.</p>
<p>That covers the 4 mistakes you should be careful of making while learning to code. Learning to code is a challenging, timely process. Take your time, enjoy the process and you'll become a great developer some day.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Understanding Units In CSS]]></title><description><![CDATA[Introduction
There are plenty of units in CSS. From px to vh, there is an abundance of units all with their distinctive use cases. Considering the amount of options, its perfectly reasonably to be confused as to which unit you should use and where. T...]]></description><link>https://blog.blakeyeboah.com/understanding-units-in-css</link><guid isPermaLink="true">https://blog.blakeyeboah.com/understanding-units-in-css</guid><category><![CDATA[CSS]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 07 Apr 2022 14:56:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/WahfNoqbYnM/upload/v1649341958967/xjksiCPpR.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>There are plenty of units in CSS. From <code>px</code> to <code>vh</code>, there is an abundance of units all with their distinctive use cases. Considering the amount of options, its perfectly reasonably to be confused as to which unit you should use and where. This article aims to simplify CSS units and explain what each unit is and in what situations you may consider using it.</p>
<h1 id="heading-units">Units</h1>
<p>In case you're unaware or unsure, a unit in CSS  (like in maths) is essentially a type of measurement. When adding margins, or adjusting font size, the value you enter is a quantity of units (e.g 6px) which the browser understands and is able to appropriate display the content.</p>
<p>Before mentioning specific units, I'd like to talk about absolute and relative units and the different between them.</p>
<h2 id="heading-absolute-vs-relative">Absolute vs Relative</h2>
<p>The two types of length units are <strong>absolute</strong> and <strong>relative</strong>. Absolute units are fixed, meaning no matter the screen size or any other factor, the element will always appear to that exact size. For example, pixels (px) is an absolute length unit since <code>50px</code> will be <code>50px</code> no matter the width of the screen. Relative units specify lengths relative to another length property. For example, <code>vw</code> is a relative unit that represents <code>1%</code> of the viewport's width. This means if you set a div's width to <code>50vw</code>, on both large desktop screens and mobile screens it will take up 50 percent of the viewport's width which isn't equivalent between a mobile and desktop device (desktop is larger, obviously).</p>
<p>Now, lets talk about a few different units and where you would probably want to use them.</p>
<h2 id="heading-pixels-px">Pixels (px)</h2>
<p>Pixels is one of the most commonly used units. Its probably the unit you first saw when learning CSS. Pixels have a variety of use cases, including:</p>
<ul>
<li>Font Sizes</li>
<li>Widths &amp; Heights</li>
<li>Margins &amp; Padding</li>
</ul>
<p>Pixels are great, however if you want your website to better adapt to different screen sizes (be responsive) a relative unit would probably work better. Pixels can still work in a lot of situations though like adding a margin between elements in a list. It heavily depends on the exact circumstance, however a good rule of thumb is if the space needs to constantly change (like get reduced) based on the screen size (width or height) there is probably a more suitable relative unit.</p>
<h2 id="heading-inches-in">Inches (in)</h2>
<p>Inches are another absolute unit. An inch is equal to 96 pixels. To be entirely honest, I have never actually used this unit, however if your web page is specifically built to be printed, they can be helpful to control spacing between elements.</p>
<h2 id="heading-em-andamp-rem-units"><code>em</code> &amp; <code>rem</code> units</h2>
<p>Em and Rem units are very powerful relative length units that I use and see all the time. An <code>em</code> unit is relative to the font-size of the element. For instance, <code>3em</code> is equal to 3 times the size of the current font. This is a great element to be used for margins and padding that will decrease as the size of the element decreases. This also helps you reduce the amount of media queries you will need to write to your website responsive :)</p>
<p>On the other hand, <code>rem</code> units are relative to the font-size of the root element. This means if your <code>html</code> element has a font-size of <code>24px</code>,  <code>2rem</code> is equal to 2 times <code>24px</code> meaning <code>48px</code>. <code>rem</code> units are great for setting font-size of paragraphs and headings throughout your document since you can reduce all text sizes by simply changing the root element's font-size.</p>
<p><code>em</code> and <code>rem</code> units are two of the most helpful units I've learned in my CSS journey and I'd highly recommend using them. They are very practical for creating scalable and responsive layouts. I'd recommend <code>em</code> units for margins and padding, as well as <code>rem</code> units for font-sizes.</p>
<h2 id="heading-percentage">Percentage (%)</h2>
<p>The percentage unit is fairly self-explanatory. It is relative to the parent element. For example, if the width of the <code>body</code> is <code>500px</code>, a div with the width of <code>50%</code> which be half of that meaning <code>250px</code>. Percentage units are also very useful since they can be used to scale layouts appropriately as the size of the screen varies.</p>
<p>Percentage units should be used for widths and heights of paragraphs, or divs where you control the width of the parent element.</p>
<h2 id="heading-vw-and-vh-units"><code>vw</code> and <code>vh</code> units</h2>
<p><code>vw</code> and <code>vh</code> units are more relative length units that are very helpful when creating scalable, responsive web pages. A <code>vw</code> unit is equivalent to <code>1%</code> of the width of the viewport and a <code>vh</code> unit is equivalent to <code>1%</code> of the height of the viewport. This means that you can set deeply nested elements to take up half the screen no matter the size of the screen.</p>
<p>I often use <code>vw</code> units when I want the content to shrink as the width of the page shrinks. The same applies to <code>vh</code> units just based on the height. You can use these units for:</p>
<ul>
<li>Margins</li>
<li>Padding</li>
<li>Widths</li>
<li>Heights</li>
</ul>
<p>You can even set a font-size to these units for them to consistently shrink with the page however, I'd recommend using <code>rem</code> units for font-size.</p>
<h1 id="heading-take-away">Take Away</h1>
<p>We've covered many units that are available in CSS. I've provided my personal recommendations for when and where you should use each unit as well as provided a general overview of what the unit represents. One key takeaway from this article is that relative units (<code>vw</code>, <code>%</code>, etc) should be used more often than absolute units to create responsive websites that scale appropriately. </p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[JavaScript DOM Methods You Should Know]]></title><description><![CDATA[👋 Hey All,
Today, I'm gonna show you 15 DOM methods in JavaScript that I believe are essential for every JS developer to know.
These methods will help you in a variety of ways and are very helpful to have in your toolbelt when building applications ...]]></description><link>https://blog.blakeyeboah.com/javascript-dom-methods-you-should-know</link><guid isPermaLink="true">https://blog.blakeyeboah.com/javascript-dom-methods-you-should-know</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[vanilla-js]]></category><category><![CDATA[DOM]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Wed, 06 Apr 2022 06:35:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/f77Bh3inUpE/upload/v1649223063635/u6UBLN9fs.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>👋 Hey All,</p>
<p>Today, I'm gonna show you 15 DOM methods in JavaScript that I believe are essential for every JS developer to know.</p>
<p>These methods will help you in a variety of ways and are very helpful to have in your toolbelt when building applications with JavaScript.</p>
<p><br /></p>
<h1 id="heading-the-methods">The Methods</h1>
<h2 id="heading-getelementbyid">getElementById</h2>
<p>The getElementById method allows you to select a DOM element by its Id as the name suggests:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"fun"</span>);
</code></pre>
<p>This code will select the DOM element with an ID of <code>fun</code>. </p>
<p>You would probably want to store this in a variable so you can use it multiple times without repeating yourself:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> fun = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"fun"</span>);
</code></pre>
<h2 id="heading-queryselector">querySelector</h2>
<p>The querySelector method allows you to select a DOM element by a CSS selector:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#fun"</span>);
</code></pre>
<p>This code will also select the DOM element with an ID of <code>fun</code> however <code>querySelector</code> can be used with any CSS selector.</p>
<p>For example, by class:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">".cool-class"</span>);
</code></pre>
<p>By element:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"p"</span>);
</code></pre>
<p>Or any other CSS selector.</p>
<p>Another cool aspect of this method is that it can be called on a parent element to select a child that matches the query.</p>
<p>For example, if you have got a paragraph with a class of text inside of a div, you can select it with the following code:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> div = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"div"</span>);
<span class="hljs-keyword">const</span> paragraph = div.querySelector(<span class="hljs-string">"#text"</span>);
</code></pre>
<h2 id="heading-queryselectorall">querySelectorAll</h2>
<p>The querySelectorAll method is very similar to the querySelector however it returns a <code>NodeList</code> with all elements it found rather than just a single node.</p>
<p>For example, to select all paragraph elements on a page:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> paragraphs = <span class="hljs-built_in">document</span>.querySelectorAll(<span class="hljs-string">"p"</span>);
</code></pre>
<p>It is also important to know that a <code>NodeList</code> is different to an <code>Array</code> so you can't call array methods on it. However, you can convert a <code>NodeList</code> to an <code>Array</code> using the spread operator:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> arr = [...paragraphs];
</code></pre>
<p>Now you can use methods like 'forEach<code>on the</code>arr` variable since its now an array.</p>
<h2 id="heading-createelement">createElement</h2>
<p>We know how we can select elements that already exist in the DOM. But how can we create them? For that, the <code>createElement</code> method can be used.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> div = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"div"</span>);
</code></pre>
<p>This code simply creates a div. However, the element won't be found on the page because we haven't inserted it yet. For that, we can use the <code>appendChild</code> method.</p>
<h2 id="heading-appendchild">appendChild</h2>
<p>The appendChild allows us to append a Node into the dom:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.body.appendChild(div)
</code></pre>
<p>This code will append the div we just created inside of the body element.</p>
<p>It is important to know that the <code>appendChild</code> element only appends nodes and not text.</p>
<h2 id="heading-removechild">removeChild</h2>
<p>The removeChild method allows us to remove a child from the DOM.</p>
<p>For example, lets insert a paragraph inside of the div we just created:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> div = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"div"</span>);
<span class="hljs-keyword">const</span> paragraph = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"p"</span>);
div.appendChild(paragraph);
<span class="hljs-built_in">document</span>.body.appendChild(div);
</code></pre>
<p>We can then remove the paragraph element:</p>
<pre><code class="lang-javascript">div.removeChild(paragraph);
</code></pre>
<p>This method can also be used to remove an element that was already in the DOM, not one you just inserted. For instance:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.body.removeChild(<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#someElement"</span>));
</code></pre>
<p>This code will remove the element with an ID of <code>someElement</code> from the body.</p>
<h2 id="heading-textcontent">textContent</h2>
<p>The textContent method lets us change the text in an element. For instance, lets change the text of a paragraph element with an ID of <code>text</code>:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#text"</span>).textContent = <span class="hljs-string">"I'm loving this article :)"</span>;
</code></pre>
<p>This will change the text of the element with an ID of <code>text</code>. This method can be called on any node so we can use it to add text to elements we create.</p>
<p>For example, lets create a paragraph and change its text, then append it to the body:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> paragraph = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"p"</span>);
paragraph.textContent = <span class="hljs-string">"This is a cool paragraph!"</span>;
<span class="hljs-built_in">document</span>.body.appendChild(paragraph);
</code></pre>
<h2 id="heading-innerhtml">innerHTML</h2>
<p>The innerHTML method lets us change the HTML inside of an element. For example, we can add a div inside of the body:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.body.innerHTML += <span class="hljs-string">"&lt;div&gt;My Div&lt;/div&gt;"</span>
</code></pre>
<p>The key difference between <code>innerHTML</code> and <code>textContent</code> is that <code>innerHTML</code> lets us change the HTML as well as whatever text we want inside, while <code>textContent</code> only lets us change the text.</p>
<h2 id="heading-getattribute">getAttribute</h2>
<p>The getAttribute method lets us retrieve the value of any attribute on an element.</p>
<p>For example, we can select the href of an <code>a</code> tag:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"a"</span>).getAttribute(<span class="hljs-string">"href"</span>);
</code></pre>
<p>This method can be used to retrieve any attribute on any element.</p>
<h2 id="heading-setattribute">setAttribute</h2>
<p>The setAttribute method lets us set the value of an attribute on an element.</p>
<p>For example, lets change the href of an <code>a</code> tag:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"a"</span>).setAttribute(<span class="hljs-string">"href"</span>, <span class="hljs-string">"/somewhere-else"</span> );
</code></pre>
<p>The first argument is the attribute name and the second is the value.</p>
<h2 id="heading-addeventlistener">addEventListener</h2>
<p>The addEventListener method is used to run a function when an event is triggered.</p>
<p>For example, lets log something to the console when a button is clicked:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> btn = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"button"</span>);
<span class="hljs-keyword">const</span> logFunction = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Button was clicked"</span>);
}
btn.addEventListener(<span class="hljs-string">"click"</span>, logFunction);
</code></pre>
<p>The first argument is the event name (there are plenty of them, do a quick google search to see them all) and the second is the function we want to run. It is best to store the function in a variable as we have done rather than use an anonymous function so that the event listener can be removed in the future if we wish.</p>
<h2 id="heading-removeeventlistener">removeEventListener</h2>
<p>The removeEventListener method lets us remove an event listener.</p>
<p>For example, to remove the click event listener we added to the button above:</p>
<pre><code class="lang-javascript">btn.removeEventListener(<span class="hljs-string">"click"</span>, logFunction)
</code></pre>
<p>Now, when the button is clicked <code>logFunction</code> will no longer run. </p>
<h2 id="heading-classlist-add-remove-contains">classList (add(), remove(), contains())</h2>
<p>Finally, lets discuss the classList property which contains 3 methods:</p>
<ul>
<li>The <code>add</code> method</li>
<li>The <code>remove</code> method</li>
<li>&amp; The <code>contains</code> method</li>
</ul>
<p>The classList property exists on all nodes and returns a DOMTokenList of all classes on the particular element.</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList;
</code></pre>
<p>This code retrieved all classes on the <code>h1</code> element.</p>
<h3 id="heading-add">add()</h3>
<p>We can call the <code>add</code> method on the classList to add a class to an element:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList.add(<span class="hljs-string">"myClass"</span>);
</code></pre>
<p>We can also pass in multiple classes to add multiple classes at once:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList.add(<span class="hljs-string">"myClass"</span>, <span class="hljs-string">"anotherClass"</span>, <span class="hljs-string">"thirdClass"</span>);
</code></pre>
<h3 id="heading-remove">remove()</h3>
<p>We can call the <code>remove</code> method on the classList to remove a class from an element:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList.remove(<span class="hljs-string">"myClass"</span>);
</code></pre>
<p>We can also pass in multiple classes to remove multiple classes at once:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList.remove(<span class="hljs-string">"myClass"</span>, <span class="hljs-string">"anotherClass"</span>);
</code></pre>
<h3 id="heading-contains">contains()</h3>
<p>We can call the <code>contains</code> method on the classList to see if an element has a certain class:</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"h1"</span>).classList.contains(<span class="hljs-string">"myClass"</span>); <span class="hljs-comment">// true or false</span>
</code></pre>
<p>This methods return a boolean and can be used in conditional statements as well as.</p>
<p><br /></p>
<h1 id="heading-take-away">Take Away</h1>
<p>This was a very long article with a lot of information. We've covered plenty of DOM methods that will really up your JavaScript developed skills. I recommend you play around these methods to get a better grasp of their use cases and why they are useful.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Create 3 Different Navbar Layouts With Flexbox]]></title><description><![CDATA[Hey everyone, in this short tutorial I'm gonna show you how to create 3 common navbar layouts using HTML, CSS and Flexbox. 
Lets get right into it!
The First Navbar

This is the first navbar we will be building. It is a very common layout used by man...]]></description><link>https://blog.blakeyeboah.com/create-3-different-navbar-layouts-with-flexbox</link><guid isPermaLink="true">https://blog.blakeyeboah.com/create-3-different-navbar-layouts-with-flexbox</guid><category><![CDATA[HTML5]]></category><category><![CDATA[CSS]]></category><category><![CDATA[flexbox]]></category><category><![CDATA[css flexbox]]></category><category><![CDATA[navigation]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Wed, 06 Apr 2022 04:48:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/ieic5Tq8YMk/upload/v1649227005400/Ej_HNOunw.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone, in this short tutorial I'm gonna show you how to create 3 common navbar layouts using HTML, CSS and Flexbox. </p>
<p>Lets get right into it!</p>
<h2 id="heading-the-first-navbar">The First Navbar</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649217858321/LPSch3huv.png" alt="Brand on the left with links on the right" /></p>
<p>This is the first navbar we will be building. It is a very common layout used by many websites out there. It has the brand name on the left side and the navigation links on the right side.</p>
<h3 id="heading-the-markup">The Markup</h3>
<p>The HTML markup for this navbar is fairly straight forward:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-brand"</span>&gt;</span>My Website<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-links"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>About<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Shop<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Contact<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<p>We have a <code>nav</code> element wrapping all of the content with a class of <code>navbar</code>. We then have a <code>h2</code> which contains the website's title/brand. We then have an unordered list with a <code>li</code> for each navigation link that includes an <code>a</code> tag.</p>
<h3 id="heading-the-styling">The Styling</h3>
<p>To style this navbar, we will first need some basic styling for the content within. This includes changing the color of the content to match the purple background and displaying the links horizontally:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.nav-links</span> {
    <span class="hljs-attribute">display</span>: flex;
    <span class="hljs-attribute">list-style</span>: none;
}

<span class="hljs-selector-class">.nav-item</span><span class="hljs-selector-pseudo">:not(</span><span class="hljs-selector-pseudo">:first-of-type)</span> {
    <span class="hljs-attribute">margin-left</span>: <span class="hljs-number">1.5em</span>;
}

<span class="hljs-selector-class">.nav-link</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
    <span class="hljs-attribute">text-decoration</span>: none;
    <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">500</span>;
}
</code></pre>
<p>We can now add some styling to the navbar to change its size, colors and spacing:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.navbar</span> {
    <span class="hljs-attribute">width</span>: <span class="hljs-number">100vw</span>;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">7.5vh</span>;
    <span class="hljs-attribute">background</span>: <span class="hljs-number">#855FF6</span>;
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">5vw</span>;
}
</code></pre>
<p>Obviously, the height, colors and padding can be adjusted for this navbar to suit your circumstances. </p>
<p>Now let's use flexbox to align the content:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.navbar</span> {
    <span class="hljs-attribute">display</span>: flex;
    <span class="hljs-attribute">align-items</span>: center;
    <span class="hljs-attribute">justify-content</span>: space-between;
}
</code></pre>
<p>A quick explanation of the above:</p>
<ul>
<li><p><code>display: flex</code> - sets the display of the navbar to flex so the items will now be displayed in a row instead of on top of each other.</p>
</li>
<li><p><code>align-items: center</code> - aligns the items (<code>h2</code> and <code>ul</code>) to the center vertically. This means whatever the height of the navbar is, the content will be in the center.</p>
</li>
<li><p><code>justify-content: space-between</code> - puts space between the items so the <code>h2</code> will stay to the left and the <code>ul</code> will be positioned on the far right.</p>
</li>
</ul>
<h2 id="heading-the-second-navbar">The Second Navbar</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649218802405/lrubAlTWc.png" alt="Brand on the left, links in the middle and button on right" /></p>
<p>The second navbar is another reasonably common layout. It has got the title/brand on the left side, the links in the middle and button on the right side.</p>
<h3 id="heading-the-markup">The Markup</h3>
<p>The markup is very similar to the previous navbar with the addition of the button after the <code>.nav-links</code> list:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h2</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-brand"</span>&gt;</span>My Website<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-links"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>About<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Shop<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Contact<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-btn"</span>&gt;</span>Create Account<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<h3 id="heading-the-styling">The Styling</h3>
<p>Interestingly, the exact same styling used in the previous navbar will make this navbar layout. The reason why is because <code>justify-content: space-between;</code> with three children instead of two children positions the middle child element (in this case, the links) in the center with the adjacent elements on the far left (the <code>h2</code>) and far right (the <code>button</code>). </p>
<p>You will however need to add styling to the button:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.nav-btn</span> {
    <span class="hljs-attribute">height</span>: fit-content;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1.5em</span>;
    <span class="hljs-attribute">background-color</span>: transparent;
    <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#fff</span>;
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
    <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">5px</span>;
    <span class="hljs-attribute">cursor</span>: pointer;
}
</code></pre>
<p>Now, lets move on to the final navbar layout</p>
<h2 id="heading-the-third-navbar">The Third Navbar</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649219499909/FuWtCPW09.png" alt="links in the middle" /></p>
<p>The third and final layout we will be creating is a simple navbar with the links in the middle and no brand nor button.</p>
<h3 id="heading-the-markup">The Markup</h3>
<p>The markup is quite simple yet again:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-links"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>About<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Shop<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span>&gt;</span>Contact<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<p>Same markup without the <code>h2</code> or <code>button</code>.</p>
<h3 id="heading-the-styling">The Styling</h3>
<p>The styling is the same again however set <code>justify-content</code> to <code>center</code> rather than <code>space-between</code>. This will align the links to the center of the navbar horizontally.</p>
<h2 id="heading-take-away">Take Away</h2>
<p>Today, I've shown you how to create 3 different common navbar layouts. I hope you've learned something useful and can start using these layouts in your websites.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Create Awesome Images Of Your Code]]></title><description><![CDATA[👋 Hey All,
Today, I'm going to show you two tools that you can use to generate beautiful, presentable images of your code that can be shared on social media.

The First Tool - ray.so
The first tool I'll show you is called ray.so. It was made by the ...]]></description><link>https://blog.blakeyeboah.com/create-awesome-images-of-your-code</link><guid isPermaLink="true">https://blog.blakeyeboah.com/create-awesome-images-of-your-code</guid><category><![CDATA[images]]></category><category><![CDATA[code]]></category><category><![CDATA[social media]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 10 Mar 2022 07:04:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893411692/TUsrS5oJ8.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>👋 Hey All,</p>
<p>Today, I'm going to show you two tools that you can use to generate beautiful, presentable images of your code that can be shared on social media.</p>
<p><br /></p>
<h1 id="heading-the-first-tool-raysohttpsrayso">The First Tool - <a target="_blank" href="https://ray.so/">ray.so</a></h1>
<p>The first tool I'll show you is called ray.so. It was made by the company Raycast and has a really simple UI to use.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893658747/1ozMywkYx.png" alt="Ray.so" /></p>
<p>You simply enter your code in the code box, adjust the settings at the bottom and then click export. You can select from 8 different colors and 4 different padding options. </p>
<p>Some of my favourite colors include:</p>
<h3 id="heading-meadow">Meadow</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893831515/O0wyg-tnD.png" alt="Meadow Code Image" /></p>
<h3 id="heading-breeze">Breeze</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893853045/7qDz6XOELn.png" alt="Breeze Code Image" /></p>
<h3 id="heading-raindrop">Raindrop</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893895222/rYCQnbrla.png" alt="Raindrop Code Image" /></p>
<h3 id="heading-candy">Candy</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646893875234/Rc8DIPPGB.png" alt="Candy Code Image" /></p>
<p>It also supports a ton of different languages such as JavaScript, HTML, CSS and a bunch more. You can export the image as a PNG or SVG as well as just copying the URL to share.</p>
<p>That just about covers <a target="_blank" href="https://ray.so/">ray.so</a>, lets move on to the next tool.</p>
<p><br /></p>
<h1 id="heading-the-second-tool-carbonhttpscarbonnowsh">The Second Tool - <a target="_blank" href="https://carbon.now.sh/">Carbon</a></h1>
<p>Carbon is another fantastic tool to create images of your code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646895502406/PpqnkPu4f.png" alt="Carbon" /></p>
<p>As with ray.so, you can enter your code into the code box, adjust the settings and export the image.</p>
<p>With carbon, you have a lot of customization available including:</p>
<ul>
<li>Selecting the color theme</li>
<li>Changing the background color (or choosing an image)</li>
<li>Changing the padding (both vertically and horizontally</li>
<li>Adding a drop shadow</li>
<li>Customizing the code box window's outline</li>
</ul>
<p>You can also export it in multiple sizes as either a PNG or SVG. They also have a bunch of presets you can use in the settings menu.</p>
<h1 id="heading-take-away">Take Away</h1>
<p>Today, I've shown you two different awesome tools that allow you to create images with your code. These images can then be shared on social media, added to blog posts or used however you wish. I hope you've learned something useful today!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639870937/UoEISa7Ow.gif" alt="Awesome Gif" /></p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Deploy Your React App Using Netlify]]></title><description><![CDATA[👋 Hey All,
Today I'm going to show you how to deploy a react application with a service called Netlify. This method is completely free and allows you to automatically publish your web app by committing to your GitHub repo.
Lets get started!
Create A...]]></description><link>https://blog.blakeyeboah.com/deploy-your-react-app-using-netlify</link><guid isPermaLink="true">https://blog.blakeyeboah.com/deploy-your-react-app-using-netlify</guid><category><![CDATA[Netlify]]></category><category><![CDATA[React]]></category><category><![CDATA[deployment]]></category><category><![CDATA[Deploy ]]></category><category><![CDATA[free]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Mon, 07 Mar 2022 07:59:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646638487482/Fjd0g2r-8.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>👋 Hey All,</p>
<p>Today I'm going to show you how to deploy a react application with a service called Netlify. This method is completely free and allows you to automatically publish your web app by committing to your GitHub repo.</p>
<p>Lets get started!</p>
<h1 id="heading-create-a-netlify-account">Create A Netlify Account</h1>
<p>Firstly, head over to <a target="_blank" href="https://www.netlify.com/">Netlify's website</a> and create a free account following their directions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646638751460/FFmvFo-zH.png" alt="Netlify Sign Up Page" /></p>
<blockquote>
<p>Image: Netlify's sign up page</p>
</blockquote>
<h1 id="heading-import-project-from-git">Import Project From Git</h1>
<p>Click on the <code>Import from Git</code> button under the "sites" heading on the overview page:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639055537/lqr9EUOz1.png" alt="Sites Section" /></p>
<h1 id="heading-connect-to-github">Connect To GitHub</h1>
<p>Then, connect to GitHub by clicking on the "GitHub" option:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639123535/Xa1lnoT1k.png" alt="Import Section" /></p>
<h1 id="heading-pick-your-repository">Pick your repository</h1>
<p>Pick the project repository you wish to deploy:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639245792/1KVtX7-nW.png" alt="Pick A Repository Screen" /></p>
<h1 id="heading-configure-build-settings">Configure Build Settings</h1>
<p>Before clicking deploy, make sure that your settings are correct under the <code>Basic build settings</code> header:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639348551/ndMLkPm3e.png" alt="Build Settings" /></p>
<p>Make sure the <strong>build command</strong> is set to <code>yarn build</code> or <code>npm build</code>.</p>
<p>Make sure the <strong>publish directory</strong> is set to <code>build</code>.</p>
<blockquote>
<p>I believe Netlify automatically detects a React app and configures these settings for you but check to be safe 😀</p>
</blockquote>
<h1 id="heading-deploy-site">Deploy site</h1>
<p>Click on the <code>Deploy Site</code> button and your react app will start building and then be deployed.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639531135/Cph_1A4R9.png" alt="Deploy Site" /></p>
<p>The site will be deployed on a weird domain name ending with <code>.netlify.app</code>. You can change the site name in site settings which will also adjust the domain for you.</p>
<h1 id="heading-benefits-of-this-method">Benefits Of This Method</h1>
<p>By deploying your react app on Netlify, you:</p>
<ul>
<li><p>Get automatic deploys from your GitHub repo</p>
</li>
<li><p>Get a free SSL certificate that is automatically setup</p>
</li>
<li><p>Can connect your custom domain to your application (topic for another article)</p>
</li>
<li><p>Get access to cool features like forms (for handling form submissions), identity (authentication), analytics (paid unfortunately) and many more 😀</p>
</li>
</ul>
<h1 id="heading-take-away">Take Away</h1>
<p>In this article, you've learned how to deploy your React application to Netlify for free. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646639870937/UoEISa7Ow.gif" alt="Awesome Gif" /></p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[The Benefits Of Participating In A Hashnode Hackathon]]></title><description><![CDATA[Introduction
Recently, I competed in my first Hackathon which was the Netlify X Hashnode Hackathon that concluded at the end of February. 
I really enjoyed the experience and wanted to share the benefits I found of participating in a Hashnode Hackath...]]></description><link>https://blog.blakeyeboah.com/the-benefits-of-participating-in-a-hashnode-hackathon</link><guid isPermaLink="true">https://blog.blakeyeboah.com/the-benefits-of-participating-in-a-hashnode-hackathon</guid><category><![CDATA[Hashnode]]></category><category><![CDATA[hackathon]]></category><category><![CDATA[General Advice]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 03 Mar 2022 12:16:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646302909323/TnQjUxdmY.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Recently, I competed in my first Hackathon which was the <a target="_blank" href="https://townhall.hashnode.com/netlify-hackathon">Netlify X Hashnode Hackathon</a> that concluded at the end of February. </p>
<p>I really enjoyed the experience and wanted to share the benefits I found of participating in a Hashnode Hackathon. Additionally, with the <a target="_blank" href="https://townhall.hashnode.com/hasura-hackathon">Hasura Hackathon</a> taking place now, this article details various reasons why you should make the most of this opportunity and participate.</p>
<p>Also, feel free to check out my article for the Netlify Hackathon here: <a target="_blank" href="https://blog.blakeyeboah.com/introducing-code-network-a-social-network">Introducing Code Network - A Social Network</a></p>
<p><br /></p>
<h1 id="heading-the-benefits">The Benefits</h1>
<h2 id="heading-1-win-a-prize">#1: Win A Prize</h2>
<p>One of the benefits of participating in a Hashnode hackathon is that if your submission is good enough, you may win a prize. Depending on the hackathon, the prize may be cash, cool merchandise, specific platform credits or a gift card. </p>
<p>Hashnode hackathon typically have 5 grand prizes as well as 10 runner up prizes so there's plenty of opportunity for you to be a winner. Additionally, you get a participation badge on your blog which is awarded to all winners.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646308732706/eFvezNKGa.gif" alt="Happy Dance" /></p>
<h2 id="heading-2-learn-andamp-grow">#2: Learn &amp; Grow</h2>
<p>Another great benefit of participating is that you will certainly learn from the experience. Whether you learn a new platform the hackathon is based on, or just learn how to document your work, the learning experience is great and helps you grow as a developer.</p>
<p>In the Netlify Hackathon I recently participated in, I learned how to use Netlify Functions which I will certainly be implemented in some of my future projects. I also learned how to document my work in the form of an article, and how to create an open-source project.</p>
<p>There is no doubt that Hashnode hackathons are great opportunities to learn and grow as a developer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646308790458/WIOBuRCgK.gif" alt="You gone learn today GIF" /></p>
<h2 id="heading-3-gain-recognition">#3: Gain Recognition</h2>
<p>Another benefit is earning recognition for your skills. There is no doubt that getting noticed for what you are capable of is a challenge in the development community. However, with Hashnode hackathons, you can get the recognition that you deserve by putting in the effort to build a great application. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646308880239/ofEMMp-6G.gif" alt="Recognition GIF" /></p>
<h2 id="heading-4-launching-real-apps">#4: Launching Real Apps</h2>
<p>By taking part in a Hashnode hackathon, you get the opportunity to launch your own awesome application and see what the community thinks of your work. Hashnode hackathons are a fantastic way to gain practical experience building and launching a real application.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646309005248/NYRy7sY2L.gif" alt="Rocket GIF" /></p>
<h2 id="heading-5-have-fun">#5: Have Fun</h2>
<p>Last but certainly not least, you get to have an awesome, fun experience building and sharing your application. I can tell you from my personal experience that the journey from building an application, writing an article about it and sharing it with the awesome Hashnode community is incredibly fun and rewarding.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646309081554/qkh27LjU1.gif" alt="Have Fun GIF" /></p>
<p><br /></p>
<h1 id="heading-take-away">Take Away</h1>
<p>If you do decide to start taking part in Hashnode hackathons, just remember:</p>
<ul>
<li><p>Whether you win or not doesn't matter. Either way you've built a cool project to show off to the world (and add to your portfolio) whilst having fun.</p>
</li>
<li><p>Try to learn as much as you can and enjoy the experience</p>
</li>
<li><p>Check out what other people are building and spread positivity with reactions and comments 😀</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646309116228/ePFlALhvE.gif" alt="Its A Win Win Gif" /></p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Enable Smooth Scrolling With One Line of CSS]]></title><description><![CDATA[In this article, I'll be showing you how to add smooth scrolling to your website with just one line of CSS. 
But firstly, what is smooth scrolling?

What Is Smooth Scrolling?
Imagine a scenario when you have a button that navigates to a different sec...]]></description><link>https://blog.blakeyeboah.com/enable-smooth-scrolling-with-one-line-of-css</link><guid isPermaLink="true">https://blog.blakeyeboah.com/enable-smooth-scrolling-with-one-line-of-css</guid><category><![CDATA[CSS]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[HTML5]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 03 Mar 2022 10:15:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646301746429/P7uBOjE61.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I'll be showing you how to add smooth scrolling to your website with just one line of CSS. </p>
<p>But firstly, what is smooth scrolling?</p>
<p><br /></p>
<h1 id="heading-what-is-smooth-scrolling">What Is Smooth Scrolling?</h1>
<p>Imagine a scenario when you have a button that navigates to a different section of your website. With smooth scrolling enabled, clicking that button will smoothly scroll to that section of the website rather than instantly snapping. </p>
<p>See it in action:</p>
<p>Hit the 'About Me' link on this <a target="_blank" href="https://www.blakeyeboah.com/">website</a>. </p>
<p>You will notice it smoothly scrolls down to the about section. </p>
<p>This effect is present on plenty of websites and is a useful arrow in your quiver so let's get into the code.</p>
<p><br /></p>
<h1 id="heading-the-css">The CSS</h1>
<p>To add smooth scrolling to your website simply add the following code to your CSS file:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">html</span> { <span class="hljs-attribute">scroll-behavior</span>: smooth }
</code></pre>
<p>That's it. You have now added smooth scrolling to your website.</p>
<p>There is one caveat with this method that is its not supported by Safari (at least not on mobile) but other than that it is a great solution that doesn't involve any JavaScript.</p>
<p><br /></p>
<h1 id="heading-take-away">Take Away</h1>
<p>In this article, I've shown you how to add smooth scrolling to your website with just one line of CSS. Pretty cool right?</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Setup Tailwind CSS v3 With React]]></title><description><![CDATA[In this article, I'll be showing you how to setup Tailwind CSS v3 with React so you start building great UIs in React with Tailwind's utility classes.

Bootstrap React App
First, lets create a new react app using create-react-app:
npx create-react-ap...]]></description><link>https://blog.blakeyeboah.com/setup-tailwind-css-v3-with-react</link><guid isPermaLink="true">https://blog.blakeyeboah.com/setup-tailwind-css-v3-with-react</guid><category><![CDATA[React]]></category><category><![CDATA[Tailwind CSS]]></category><category><![CDATA[setup]]></category><category><![CDATA[create-react-app]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 03 Mar 2022 09:59:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646300392851/ABouxNbUx.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I'll be showing you how to setup Tailwind CSS v3 with React so you start building great UIs in React with Tailwind's utility classes.</p>
<p><br /></p>
<h1 id="heading-bootstrap-react-app">Bootstrap React App</h1>
<p>First, lets create a new react app using <code>create-react-app</code>:</p>
<pre><code>npx create<span class="hljs-operator">-</span>react<span class="hljs-operator">-</span>app app<span class="hljs-operator">-</span>name
</code></pre><p>Then change into its directory:</p>
<pre><code>cd app-<span class="hljs-type">name</span>
</code></pre><blockquote>
<p>Replacing app-name with the name of your application</p>
</blockquote>
<p><br /></p>
<h1 id="heading-installing-andamp-initializing-tailwind">Installing &amp; Initializing Tailwind</h1>
<p>Next, we can install Tailwind CSS and its peer dependencies as dev dependenciees:</p>
<pre><code><span class="hljs-built_in">npm</span> install -D tailwindcss postcss autoprefixer
</code></pre><p>After installing the dependencies, we can run the init command to generate a <code>tailwind.config.js</code> file:</p>
<pre><code>npx tailwindcss <span class="hljs-keyword">init</span> -p
</code></pre><p><br /></p>
<h1 id="heading-updating-config-file">Updating Config File</h1>
<p>Next, we need to update the <code>content</code>  property in the <code>tailwind.config.js</code> file:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// tailwind.config.js</span>
<span class="hljs-built_in">module</span>.exports = {
  <span class="hljs-attr">content</span>: [
    <span class="hljs-string">"./src/**/*.{js,jsx,ts,tsx}"</span>,
  ],
  <span class="hljs-attr">theme</span>: {
    <span class="hljs-attr">extend</span>: {},
  },
  <span class="hljs-attr">plugins</span>: [],
}
</code></pre>
<p><br /></p>
<h1 id="heading-add-tailwind-directives-to-css-file">Add Tailwind Directives To CSS File</h1>
<p>Lastly, we need to add the following <code>@tailwind</code> directives to the <code>index.css</code> file in the <code>src</code> directory:</p>
<pre><code class="lang-css"><span class="hljs-comment">/* src/index.css */</span>
<span class="hljs-keyword">@tailwind</span> base;
<span class="hljs-keyword">@tailwind</span> components;
<span class="hljs-keyword">@tailwind</span> utilities;
</code></pre>
<p><br /></p>
<h1 id="heading-were-finished">We're Finished</h1>
<p>We can now run the react app with <code>npm start</code> and everything should be working. You can now start using Tailwind CSS in your project.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646301449919/anKdLZ5u4.gif" alt="We Did It Gif" /></p>
<p><br /></p>
<h1 id="heading-take-away">Take Away</h1>
<p>In this article, you have learned how to setup Tailwind CSS with a create-react-app project. I hope this guide has helped you and have a great day!</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, subscribe to my newsletter and follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Create Awesome Toasts With react-toastify]]></title><description><![CDATA[👋 Hey All,
In this article, I'm going to show you how to create really simple and cool toasts using the react-toastify package. 
Lets get right into it!

What Are Toasts?
Firstly, lets clarify what exactly is a 'toast':
A toast is a little pop-up th...]]></description><link>https://blog.blakeyeboah.com/create-awesome-toasts-with-react-toastify</link><guid isPermaLink="true">https://blog.blakeyeboah.com/create-awesome-toasts-with-react-toastify</guid><category><![CDATA[React]]></category><category><![CDATA[tips]]></category><category><![CDATA[tricks]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Tue, 01 Mar 2022 13:14:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646137783504/b6NEwiz-J.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>👋 Hey All,</p>
<p>In this article, I'm going to show you how to create really simple and cool toasts using the <code>react-toastify</code> package. </p>
<p>Lets get right into it!</p>
<p><br /></p>
<h1 id="heading-what-are-toasts">What Are Toasts?</h1>
<p>Firstly, lets clarify what exactly is a 'toast':</p>
<p>A toast is a little pop-up that can positioned anywhere on the screen that shows a text message to the user. For example, toasts can be used for error messages, success messages or even notifications.</p>
<p>A toast may look like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646138133710/LqPiyi-fW.png" alt="Example Toast" /></p>
<p><br /></p>
<h1 id="heading-where-does-react-toastify-fit-in">Where does react-toastify fit in?</h1>
<p><code>react-toastify</code> is a cool package I came across recently that lets you easily implements customizable toasts into your react applications. With just two lines of code, you can get a working, responsive toast that can be customized. </p>
<p>After reading this article, you can check out their full documentation <a target="_blank" href="https://fkhadra.github.io/react-toastify/introduction">here</a> to see everything you can build with react-toastify.</p>
<p><br /></p>
<h1 id="heading-installation">Installation</h1>
<p>To install react-toastify, simply run:</p>
<pre><code>npm install <span class="hljs-operator">-</span><span class="hljs-operator">-</span>save react<span class="hljs-operator">-</span>toastify
</code></pre><p>or with yarn:</p>
<pre><code>yarn <span class="hljs-keyword">add</span> react-toastify
</code></pre><p><br /></p>
<h1 id="heading-your-first-toast">Your First Toast</h1>
<p>To create your first toast, import the <code>ToastContainer</code> component and <code>toast</code> function:</p>
<pre><code><span class="hljs-keyword">import</span> { ToastContainer, toast } <span class="hljs-keyword">from</span> <span class="hljs-string">"react-toastify"</span>
</code></pre><p>You also need to import their CSS file:</p>
<p><strong>Regular Version</strong></p>
<pre><code><span class="hljs-keyword">import</span> <span class="hljs-string">'react-toastify/dist/ReactToastify.css'</span>;
</code></pre><p><strong>Minified version</strong></p>
<pre><code><span class="hljs-keyword">import</span> <span class="hljs-string">'react-toastify/dist/ReactToastify.min.css'</span>;
</code></pre><p>Finally, you can place the <code>&lt;ToastContainer /&gt;</code> component anywhere in your JSX and call the <code>toast('Message to be shown')</code> function to show the toast.</p>
<p>For example:</p>
<pre><code class="lang-javascript">  <span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
  <span class="hljs-keyword">import</span> { ToastContainer, toast } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-toastify'</span>;

  <span class="hljs-keyword">import</span> <span class="hljs-string">'react-toastify/dist/ReactToastify.css'</span>;

  <span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">const</span> handleClick = <span class="hljs-function">() =&gt;</span> {
        toast(<span class="hljs-string">"This Is A Toast!"</span>);
    }

    <span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{handleClick}</span>&gt;</span>Show Toast<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">ToastContainer</span> /&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
    );
  }
</code></pre>
<p>Pretty cool right? What makes this package even better is that you can customize the toast by passing certain optional props to the <code>ToastContainer</code> component.</p>
<p>Some options include:</p>
<ul>
<li><p><code>position</code>: which controls where the toast is positioned. Possible values include: <code>top-left</code>, <code>top-right</code>, <code>top-center</code>, <code>bottom-left</code>, <code>bottom-right</code>, and <code>bottom-center</code>.</p>
</li>
<li><p><code>autoClose</code>: which controls how many milliseconds until the toast automatically closes. E.g <code>autoClose={5000}</code> for it to last 5 seconds.</p>
</li>
<li><p><code>closesOnClick</code>: which controls whether the toast will close when its clicked on. It's value is a boolean of either <code>true</code> or <code>false</code>.</p>
</li>
<li><p><code>theme</code>: which controls the theme of the toast. This can be either <code>light</code>, <code>dark</code> or <code>colored</code>.</p>
</li>
<li><p>More options in <code>react-toastify</code>'s documentation: <a target="_blank" href="https://fkhadra.github.io/react-toastify/introduction">docs</a></p>
</li>
</ul>
<p>Additionally, there are 5 different types of toasts you can use including: <code>info</code>, <code>success</code>, <code>warning</code>, <code>error</code> and default. These just change the color of the toast as well as the icon displayed. </p>
<p>Different types in action:</p>
<p><strong>Info</strong></p>
<pre><code class="lang-javascript">toast.info(<span class="hljs-string">"Wow so easy !"</span>)
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646140051810/Kg4EUjtzS.png" alt="Info Toast" /></p>
<p><strong>Success</strong></p>
<pre><code class="lang-javascript">toast.success(<span class="hljs-string">"Wow so easy !"</span>)
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646140079301/Q3aKmWJwu.png" alt="Success Toast" /></p>
<p><strong>Warning</strong></p>
<pre><code class="lang-javascript">toast.warn(<span class="hljs-string">"Wow so easy !"</span>)
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646140145584/A1YzazZYa.png" alt="Warning Toast" /></p>
<p><strong>Error</strong></p>
<pre><code class="lang-javascript">toast.error(<span class="hljs-string">"Wow so easy !"</span>)
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646140237465/Z1o5n_S3G.png" alt="Error Toast" /></p>
<p><strong>Default</strong></p>
<pre><code class="lang-javascript">toast(<span class="hljs-string">"Wow so easy !"</span>)
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646140254635/XgPzscxAd.png" alt="Default Toast" /></p>
<blockquote>
<p>Note: Changing the <code>theme</code> option will change the appearance from these images</p>
</blockquote>
<p><br /></p>
<h1 id="heading-take-away">Take Away</h1>
<p>In This article, you have learned how to implements toasts in your react applications with the <code>react-toastify</code> library. This can be used in a wide range of scenarios such as displaying error messages and presenting warnings to a user. Recently, I used this package in a cool social network project for the Netlify X Hashnode hackathon: check it out <a target="_blank" href="https://blog.blakeyeboah.com/introducing-code-network-a-social-network">here</a> if interested.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Introducing Code Network - A Social Network 🔵⚪️]]></title><description><![CDATA[✨ Introduction
Hey everyone,
Today, I am sharing the project I have built for the Netlify X Hashnode hackathon.

🔵 About Code Network ⚪️
Code Network is an open-source social network built for developers that allows you to share posts, follow other ...]]></description><link>https://blog.blakeyeboah.com/introducing-code-network-a-social-network</link><guid isPermaLink="true">https://blog.blakeyeboah.com/introducing-code-network-a-social-network</guid><category><![CDATA[Netlify]]></category><category><![CDATA[NetlifyHackathon]]></category><category><![CDATA[social media]]></category><category><![CDATA[React]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Sun, 27 Feb 2022 13:01:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1645959879955/bKlqdl-ox.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">✨ Introduction</h1>
<p>Hey everyone,</p>
<p>Today, I am sharing the project I have built for the Netlify X Hashnode hackathon.</p>
<p><br /></p>
<h1 id="heading-about-code-network">🔵 About Code Network ⚪️</h1>
<p>Code Network is an open-source social network built for developers that allows you to share posts, follow other developers and play a fun game called Tech Trivia.  The application is hosted on <a target="_blank" href="https://www.netlify.com/">Netlify</a> which is an awesome hosting service with a bunch of valuable features. The project combines with the positive social aspects of a social network with the fun elements of playing a game.</p>
<p>Try it out the application: <a target="_blank" href="https://codenetwork.netlify.app/">Code Network</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645961126530/WfrVplj-M.png" alt="image.png" /></p>
<p><br /></p>
<h1 id="heading-the-inspiration">💡 The Inspiration</h1>
<p>I've always wanted to build a social network that is specifically tailored towards developers. I've also been wanting to get into serverless functions and building applications with them. When I saw this hackathon, I thought it would be a perfect opportunity to achieve both. I could build an awesome social network for developers whilst learning lambda functions (through Netlify Functions).</p>
<p>Hence, Code Network was born.</p>
<p><br /></p>
<h1 id="heading-features">✏️ Features</h1>
<p>Here is a list of what you can do on Code Network: </p>
<ul>
<li>Create posts</li>
<li>Read other user's posts</li>
<li>Comment on people's posts</li>
<li>Interact with posts by liking or disliking</li>
<li>Follow users</li>
<li>Play tech trivia (a fun trivia game)</li>
</ul>
<p><br /></p>
<h1 id="heading-tech-stack">⚙️ Tech Stack</h1>
<p>Code Network was built with a JavaScript tech stack including:</p>
<ol>
<li>React</li>
<li>Redux for state management (via <a target="_blank" href="https://github.com/reduxjs/redux-toolkit">reduxjs/toolkit</a>)</li>
<li>Tailwind CSS for styling</li>
<li>Netlify Serverless Functions for the backend</li>
<li>MongoDB as a DB (through Atlas)</li>
<li><a target="_blank" href="https://opentdb.com/">Open Trivia DB API</a> for trivia questions</li>
</ol>
<p><br /></p>
<h1 id="heading-what-the-application-looks-like">👀 What The Application Looks Like</h1>
<p>When you first load onto Code Network, it displays a very nice landing page:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963274525/7RoSKaZYE.png" alt="Home Screenshot" /></p>
<p>You can then create an account through the register page:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963377322/h0LdTnuTt.png" alt="Register" /></p>
<p>Or sign in through the login page:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963440144/cCBF4gYkg.png" alt="Login" /></p>
<p>Once signed up, you are taken to the home page where a introductory modal opens up and runs through a few simple questions to finish your registration:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963534611/LKZZ2EJHn.png" alt="Welcome Modal 1" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963553339/AQLFdehdR.png" alt="Welcome Modal 2" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963605796/P4Z0Tq5uu.png" alt="Welcome Modal 3" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963651787/f2hy4L5PG.png" alt="Welcome Modal 4" /></p>
<p>You can view the home page which features other people's posts, links to play tech trivia and write a post as well as a list of users to follow:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963797037/lmTrIro6_2.png" alt="Home Page" /></p>
<p>Through the navigation bar you can navigate to the users page (devs), the posts page, the trivia page or your profile through the dropdown menu on the right:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963865770/ymDBmgDON.png" alt="Dropdown Menu" /></p>
<p>The developers page (/users) lets you see others users and follow/unfollow them:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645963964021/xRLTLA0Gm.png" alt="Developers Page" /></p>
<p>The posts page (/posts) shows other people's posts and have a form up the top allowing you to write your own:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964188399/uiN4UnhpO.png" alt="Posts Page" /></p>
<p>For each post you can view and write comments as well as like/dislike:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964543714/M20ShU26H.png" alt="Individual Post" /></p>
<p>If you own the post, you can edit its details or delete it through post settings:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964585544/Z1cKs23nt.png" alt="Editing a post" /></p>
<p>The tech trivia page (/trivia) lets you play tech trivia which is a trivia game that asks you random questions about technology and tracks your score. You can select how many questions you wish to answer as well as the difficulty of questions:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964243819/5Vm9wHsgY.png" alt="Trivia Page" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964277484/3RNzIpBQv.png" alt="Trivia Page With Question" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964357977/bWwIzsNMX.png" alt="Trivia Page When Game Is Finished" /></p>
<p>The profile page (/users/:id) shows the user's name and headline and also all of the posts they have made:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645964403052/D-zrmuOvk.png" alt="Profile Page" /></p>
<p><br /></p>
<h1 id="heading-code-quality">👌 Code Quality</h1>
<p>To ensure consistent formatting throughout the code base, the code was formatted using prettier via the VS code extension.</p>
<p><br /></p>
<h1 id="heading-difficulties-i-had-to-overcome">💪 Difficulties I Had To Overcome</h1>
<p>While building the project i had to overcome a variety of bugs and problems.</p>
<p>To name a few:</p>
<ul>
<li><p>Netlify Dev not starting up server with no apparent reason why. After numerous hours, I figured out why the issue was happening and was able to fix it.</p>
</li>
<li><p>Handling authentication in a neat and organised way was a challenge at first. Since I didn't want to have to check if the user is authenticated on every protected route. To solve this, I created to separate app components (<code>AuthenticatedApp</code> and <code>UnauthenticatedApp</code>) which each help their routes for authenticated users and not authenticated users. I then conditionally rendered each app based off whether the user was authenticated or not. Got the idea from this <a target="_blank" href="https://kentcdodds.com/blog/authentication-in-react-applications">article</a>.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">return</span> (
      <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">BrowserRouter</span>&gt;</span>
          {isAuthenticated ? <span class="hljs-tag">&lt;<span class="hljs-name">AuthenticatedApp</span> /&gt;</span> : <span class="hljs-tag">&lt;<span class="hljs-name">UnauthenticatedApp</span> /&gt;</span>}
      <span class="hljs-tag">&lt;/<span class="hljs-name">BrowserRouter</span>&gt;</span></span>
  );
</code></pre>
</li>
<li><p>How to display error messages and success messages to the user in an organized manner was another challenge. I didn't want to use an Alert component in every part of the application that would need to handle errors. Fortunately, i discovered a cool package called <code>react-toastify</code> which lets you easily display all sorts of messages to the user in the form of popups. This was then implemented across the application.</p>
</li>
</ul>
<p><br /></p>
<h1 id="heading-what-i-learned-creating-the-application">🧠 What I Learned Creating The Application?</h1>
<p>I am very happy to have participated in this hackathon since I learned a lot whilst building my application and also had a fun time doing so. Some of the things I learned:</p>
<ul>
<li>How lambda functions work thanks to Netlify Functions</li>
<li>How to build a quiz style game</li>
<li>And licensing a project on GitHub</li>
</ul>
<p><br /></p>
<h1 id="heading-future-plans">🚀Future Plans</h1>
<p>In the future, I intend on adding a ton of cool features to make this application even better. </p>
<p>Some potential future features include:</p>
<ul>
<li>Custom profile pictures via cloudinary image upload</li>
<li>Attach code snippets and images to posts</li>
<li>Add links to other platforms like GitHub to a user's profile</li>
<li>Live messaging with Firebase</li>
</ul>
<p><br /></p>
<h1 id="heading-useful-links">🔗 Useful Links</h1>
<ul>
<li><a target="_blank" href="https://codenetwork.netlify.app/">Deployed Web Application</a></li>
<li><a target="_blank" href="https://github.com/Blake-K-Yeboah/code-network">GitHub Repository</a></li>
</ul>
<p><br /></p>
<h1 id="heading-thanks-again">👋 Thanks Again</h1>
<p>Thanks to Netlify and Hashnode for hosting this amazing hackathon.</p>
<p>Let me know what you think about Code Network in the comments below. If you wish to contribute to this open-source project, feel free to take a look at the contribution guide in the GitHub repo. Thanks for reading this article and have an awesome day! 🔵 ⚪️</p>
<p>Also, feel free to connect with me on other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p><strong>Twitter:</strong> <a target="_blank" href="https://twitter.com/BlakeYeboah">BlakeYeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Fetching Articles Using the Hashnode API]]></title><description><![CDATA[In this article, we'll be discussing how to fetch articles from your Hashnode blog using the Hashnode API. 
What is the Hashnode API
The Hashnode API can be found at api.hashnode.com/. It is a GraphQL API that allows us to interact with Hashnode in a...]]></description><link>https://blog.blakeyeboah.com/fetching-articles-using-the-hashnode-api</link><guid isPermaLink="true">https://blog.blakeyeboah.com/fetching-articles-using-the-hashnode-api</guid><category><![CDATA[Hashnode]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[APIs]]></category><category><![CDATA[GraphQL]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Mon, 17 Jan 2022 11:09:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1642417673559/ga9sES30P.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, we'll be discussing how to fetch articles from your Hashnode blog using the Hashnode API. </p>
<h2 id="heading-what-is-the-hashnode-api">What is the Hashnode API</h2>
<p>The Hashnode API can be found at <a target="_blank" href="https://api.hashnode.com/">api.hashnode.com/</a>. It is a GraphQL API that allows us to interact with Hashnode in a variety of ways. For instance, you can:</p>
<ul>
<li>Fetch posts from a user</li>
<li>Follow a user</li>
<li>Delete a post</li>
<li>And much more</li>
</ul>
<p>In this article, we'll just be covering how to fetch articles with the API. </p>
<p>Lets begin!</p>
<h2 id="heading-fetching-the-articles">Fetching The Articles</h2>
<p>To fetch the articles, we will be making a POST request to the API from a JavaScript file using <code>Fetch</code>.  Making the request:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">"https://api.hashnode.com/"</span>, {
    <span class="hljs-attr">method</span>: <span class="hljs-string">"POST"</span>,
    <span class="hljs-attr">headers</span>: {
        <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
    },
    <span class="hljs-attr">body</span>: <span class="hljs-built_in">JSON</span>.stringify({
        query,
        variables,
    }),
});
</code></pre>
<blockquote>
<p>This should be done inside an <code>async</code> function for <code>await</code> to work</p>
</blockquote>
<p>This won't work yet as we haven't defined the <code>query</code> or <code>variables</code> variables. </p>
<p>The <code>query</code> variable contains the actual GraphQL query we will use. This looks like this:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> query = <span class="hljs-string">`
    query GetUserArticles($page: Int!) {
        user(username: "BlakeYeboah") {
            publication {
                posts(page: $page) {
                    title
                    brief
                    slug
                    coverImage
                }
            }
        }
    }
`</span>;
</code></pre>
<blockquote>
<p>Replacing "BlakeYeboah" with your Hashnode username so it requests your articles</p>
</blockquote>
<p>The <code>variables</code> variable is an object with values for variables mentioned in the query. In this case, its just the <code>page</code> variable which has to be an integer. We'll make this <code>0</code> to get the newest articles:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> variables = { <span class="hljs-attr">page</span>: <span class="hljs-number">0</span> };
</code></pre>
<p>With these variables defined, our API request will now work. However, we must convert the JSON returned from the API into a usable JavaScript object for us to be able to access the posts we have fetched.</p>
<p>We can do this with the <code>.json()</code> method on the <code>data</code> variable which stores our request. We use <code>awai</code>t since it returns a promise. The code to do this looks like this:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> result = <span class="hljs-keyword">await</span> data.json();
</code></pre>
<p>The actual articles are nested a few properties deep:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> articles = result.data.user.publication.posts;
</code></pre>
<p>If you want more information for each post, you can adjust the GraphQL query to select other properties as well. For a list of properties available, you can view the <a target="_blank" href="https://api.hashnode.com/">docs of the API</a>.</p>
<h2 id="heading-take-away">Take Away</h2>
<p>In this article, you have learned how to fetch articles from the Hashnode API. This can be used in a variety of was and is definitely useful to know if you have a Hashnode blog. Recently, I used the API to display my latest blog posts on my personal portfolio website.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Implementing TypeScript With React]]></title><description><![CDATA[This article with cover implementing TypeScript with React. We will talk about where to use types, how to implement types with state, prop types and more. 
Lets get right into it!
Creating A React App With TypeScript
To create a react app with TypeSc...]]></description><link>https://blog.blakeyeboah.com/implementing-typescript-with-react</link><guid isPermaLink="true">https://blog.blakeyeboah.com/implementing-typescript-with-react</guid><category><![CDATA[React]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Tue, 21 Dec 2021 10:02:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1640079044281/2U7qiUKel.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article with cover implementing TypeScript with React. We will talk about where to use types, how to implement types with state, prop types and more. </p>
<p>Lets get right into it!</p>
<h2 id="heading-creating-a-react-app-with-typescript">Creating A React App With TypeScript</h2>
<p>To create a react app with TypeScript, we can use <code>create-react-app</code> with the <code>--typescript</code> flag. This will bootstrap a react application with TypeScript.</p>
<p>Using NPM:</p>
<pre><code>npx create<span class="hljs-operator">-</span>react<span class="hljs-operator">-</span>app <span class="hljs-operator">-</span><span class="hljs-operator">-</span>typescript example<span class="hljs-operator">-</span>app
</code></pre><p>Using Yarn:</p>
<pre><code>yarn create react<span class="hljs-operator">-</span>app <span class="hljs-operator">-</span><span class="hljs-operator">-</span>typescript example<span class="hljs-operator">-</span>app
</code></pre><blockquote>
<p>Change 'example-app' to the name of your application</p>
</blockquote>
<p>Once your application is setup, you will notice all js files have a .ts extension because they are now TypeScript files. </p>
<h2 id="heading-functional-components">Functional Components</h2>
<p>When creating a functional component, we can use the <code>FC</code> type exported by react to give the function a functional component type. </p>
<p>This would look like this:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">const</span> App: FC = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">return</span> &lt;div&gt;
        &lt;h1&gt;App&lt;/h1&gt;
    &lt;/div&gt;
}
</code></pre>
<p>We can also define types for props by passing in a type to FC like this:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">const</span> App: FC&lt;IProps&gt; = <span class="hljs-function">(<span class="hljs-params">props</span>) =&gt;</span> {
    <span class="hljs-keyword">return</span> &lt;div&gt;
        &lt;h1&gt;App&lt;/h1&gt;
    &lt;/div&gt;
}
</code></pre>
<blockquote>
<p>IProps would be a type or interface with the types of all props the component receives</p>
</blockquote>
<p>Alternatively, we can define the prop types like we would a regular parameter of a function:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">const</span> App: FC = <span class="hljs-function">(<span class="hljs-params">props: IProps</span>) =&gt;</span> {
    <span class="hljs-keyword">return</span> &lt;div&gt;
        &lt;h1&gt;App&lt;/h1&gt;
    &lt;/div&gt;
}
</code></pre>
<p>This would work the exact same way.</p>
<h2 id="heading-using-usestate">Using useState</h2>
<p>When using useState, we can define the type of the state by passing it in <code>&lt;&gt;</code> after the declaration. </p>
<p>This would look like this:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">const</span> [name, setName] = useState&lt;<span class="hljs-built_in">string</span>&gt;(<span class="hljs-string">"Blake"</span>);
</code></pre>
<p>The specifying the type in this case is unnecessary since it can be directly inferred from the string. It would be necessary to define the type if it may change when the value is changed.</p>
<h2 id="heading-some-other-types">Some Other Types</h2>
<p>Some other types you may want to know include:</p>
<ul>
<li><code>HTMLInputElement</code> - for html inputs</li>
<li><code>React.ChangeEvent</code> - for input change events</li>
<li><code>React.FormEvent</code> - for form submissions</li>
</ul>
<p>There are obviously plenty of types out there related to react as you build applications and implement new features you will likely run into type errors which you can solve by simply searching up the error and finding the type needed for the situation.</p>
<h2 id="heading-take-away">Take Away</h2>
<p>In this article, we have covered how to implement TypeScript with React and some common types you will often need. I hope you've learned something useful and can start using TypeScript in your React applications.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Github:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Beginner React Projects To Practice]]></title><description><![CDATA[In this article, we will be covering 4 different react projects for beginners to build to help them learn and practice building projects with React.
A Todo List
We all know what a todo list is. Its a great starter project to build since it will teach...]]></description><link>https://blog.blakeyeboah.com/beginner-react-projects-to-practice</link><guid isPermaLink="true">https://blog.blakeyeboah.com/beginner-react-projects-to-practice</guid><category><![CDATA[React]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[projects]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Tue, 21 Dec 2021 05:39:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1640063879648/lkcQSbIiQ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, we will be covering 4 different react projects for beginners to build to help them learn and practice building projects with React.</p>
<h2 id="heading-a-todo-list">A Todo List</h2>
<p>We all know what a todo list is. Its a great starter project to build since it will teach you fundamentals of React like components, state management, handling input and more. </p>
<p>Some features you would want to include:</p>
<ul>
<li>List of to-dos</li>
<li>Input field to add a to-do</li>
<li>Checkbox to mark a to-do as complete</li>
<li>Delete button to remove a to-do</li>
</ul>
<p>You can also advance this project by fetching the to-dos from an API such as <a target="_blank" href="https://jsonplaceholder.typicode.com/">JSON Placeholder</a> so that you can also practice using APIs with React.</p>
<p>If you are already reasonably comfortable with React, a to-do list probably won't be a great project since its really simple and easy to build. However, its a great project for a complete beginner to learn the basics of React.</p>
<h2 id="heading-a-weather-app">A Weather App</h2>
<p>A weather app is a simple project where the user enters what city they are in, and the application fetches data about the weather in that city from an API. This project teaches skills like using APIs, binding user data to API requests and display API data to the user.</p>
<p>Some features you would want to include:</p>
<ul>
<li>Ability to search weather by city</li>
<li>Display weather data like temperature</li>
<li>Filter weather by day</li>
</ul>
<p>There are plenty of weather APIs out there that are free to get started with making this a great project to build if you're a beginner with React.</p>
<h2 id="heading-a-notes-app">A Notes App</h2>
<p>A notes app is a simple app you can build where users can create notes and these are saved to their local storage so if the page is refreshed they can still keep their notes. This project teaches skills like managing local storage, handling user input and more.</p>
<p>Some features you would want to include:</p>
<ul>
<li>Ability to create notes</li>
<li>Ability to delete notes</li>
<li>Notes saved to local storage</li>
<li>Nicely styled notes</li>
</ul>
<p>This project is a great project for beginners since being able to use local storage is an important skill when building applications. </p>
<h2 id="heading-a-rock-paper-scissors-game">A Rock Paper Scissors Game</h2>
<p>We've all played rock paper scissors before. Its a really simple game that can be created with React where a user clicks on rock, paper or scissors and it either wins, draws or loses depending on what the computer chooses.</p>
<p>Some features you would want to include:</p>
<ul>
<li>Ability to select rock, paper or scissors</li>
<li>Generate random choice for computer each round</li>
<li>Compare user's choice and computer's choice to determine a winner</li>
</ul>
<p>This is a fun project that a beginner should build to help them learn react since it will teach them state management, handling user input and using randomly generated numbers to make decisions. </p>
<h2 id="heading-take-away">Take Away</h2>
<p>This article has covered 4 different react projects beginners can build to help them practice their skills and improve their ability to use React. Feel free to share your version of any projects mentioned here in the comments of the article.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Github:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Creating Custom Scrollbars With CSS]]></title><description><![CDATA[In this simple tutorial, I will be showing you how to style the browser's scrollbar so it can suit the aesthetic of your website. This can be done with CSS only so there's no need for any external libraries.
The Scrollbar Properties
In your CSS file,...]]></description><link>https://blog.blakeyeboah.com/creating-custom-scrollbars-with-css</link><guid isPermaLink="true">https://blog.blakeyeboah.com/creating-custom-scrollbars-with-css</guid><category><![CDATA[CSS]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[Design]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Tue, 21 Dec 2021 05:16:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1640062552104/br33MRuh9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this simple tutorial, I will be showing you how to style the browser's scrollbar so it can suit the aesthetic of your website. This can be done with CSS only so there's no need for any external libraries.</p>
<h2 id="heading-the-scrollbar-properties">The Scrollbar Properties</h2>
<p>In your CSS file, there are 3 main properties we will style with our CSS to create a custom scrollbar. </p>
<p>These include:</p>
<ul>
<li><code>::-webkit-scrollbar</code> - the actual scrollbar element</li>
<li><code>::-webkit-scrollbar-track</code> - the track part of the scrollbar (background)</li>
<li><code>::-webkit-scrollbar-thumb</code> - the scrollbar handle</li>
</ul>
<h2 id="heading-webkit-scrollbar"><code>::-webkit-scrollbar</code></h2>
<p>The first step would be to adjust the width of the scrollbar. By doing so, you will be removing the up and down arrows at the top and bottom of the scrollbar which makes it looks more minimalistic and overall better.</p>
<p>Setting the width to <code>7px</code>:</p>
<pre><code class="lang-css"><span class="hljs-selector-pseudo">::-webkit-scrollbar</span> {
    <span class="hljs-attribute">width</span>: <span class="hljs-number">7px</span>;
}
</code></pre>
<p>You can set the width to whatever value you wish. How thin you make it depends on the design of your website so experiment until one floats your boat.</p>
<h2 id="heading-webkit-scrollbar-track"><code>::-webkit-scrollbar-track</code></h2>
<p>The next step will be adjusting the background of the track. If you have a dark aesthetic on your website, you will want a dark scrollbar. And of course a light scrollbar if you have a light aesthetic.</p>
<p>To adjust the background of the track:</p>
<pre><code class="lang-css"><span class="hljs-selector-pseudo">::-webkit-scrollbar-track</span> {
    <span class="hljs-attribute">background</span>: <span class="hljs-number">#222</span>
}
</code></pre>
<p>This code sets the background to a dark grey. You can change the color to whatever you want of course.</p>
<h2 id="heading-webkit-scrollbar-thumb"><code>::-webkit-scrollbar-thumb</code></h2>
<p>After that, you will probably want to change the background of the thumb which is the handle you drag up and down to scroll through the page. The color you use will depend on the color theme of your website so adjust it accordingly.</p>
<p>The code:</p>
<pre><code class="lang-css"><span class="hljs-selector-pseudo">::-webkit-scrollbar-thumb</span> {
    <span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">138</span>, <span class="hljs-number">165</span>, <span class="hljs-number">255</span>)
}
</code></pre>
<blockquote>
<p>This code sets the background to a light blue, you can change the color of course</p>
</blockquote>
<h2 id="heading-adding-a-hover-effect-on-the-thumb">Adding A Hover Effect On The Thumb</h2>
<p>Adding a hover effect to the handle of the scrollbar is optional however it is always beneficial. You would probably want to set the color to a lighter or darker version of the handle's color rather than a completely different color. </p>
<p>To add a hover color change:</p>
<pre><code class="lang-css"><span class="hljs-selector-pseudo">::-webkit-scrollbar-thumb</span><span class="hljs-selector-pseudo">:hover</span> {
    <span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">150</span>, <span class="hljs-number">177</span>, <span class="hljs-number">255</span>)
}
</code></pre>
<h2 id="heading-browser-support">Browser Support</h2>
<p>The <code>::webkit-scroll</code> element is supported by Chrome, Edge, Safari and Opera so on those browsers we can modify the look of the browser's default scrollbar. On Firefox, you would need to use other CSS properties like <code>scrollbar-width</code> and <code>scrollbar-color</code> which is a topic for another article.</p>
<h2 id="heading-take-away">Take Away</h2>
<p>In this article, we've covered how to create a custom scrollbar using CSS without the need for any external libraries. I hope you've learned something useful and can start adding custom scrollbars to your future projects.</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Github:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[Building A Great Developer Portfolio]]></title><description><![CDATA[In this article, I will be showing you how to build a great developer portfolio to showcase your work and impress employers. We won't be running through code however I will be talking about the various sections you should include and what each entail...]]></description><link>https://blog.blakeyeboah.com/building-a-great-developer-portfolio</link><guid isPermaLink="true">https://blog.blakeyeboah.com/building-a-great-developer-portfolio</guid><category><![CDATA[portfolio]]></category><category><![CDATA[job search]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[webdev]]></category><category><![CDATA[Programming Tips]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Thu, 09 Dec 2021 06:18:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1639023611463/IR7mowtMs.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I will be showing you how to build a great developer portfolio to showcase your work and impress employers. We won't be running through code however I will be talking about the various sections you should include and what each entails. </p>
<p>Lets get right into!</p>
<h2 id="heading-what-is-your-portfolio">What Is Your Portfolio?</h2>
<p>Your portfolio is a website you build that showcases your best projects to employers or potential clients. Your portfolio is a very important component of finding a job/client since it shows what you are capable of building.</p>
<h2 id="heading-what-is-the-purpose-of-having-a-portfolio">What Is The Purpose Of Having A Portfolio?</h2>
<p>Having a portfolio allows you to directly show people projects you have built in the past that showcase your skills and what you are capable of. If you don't have a portfolio, its harder to demonstrate what you can do since you there may not be a way for an employer or client to see your work. </p>
<p>Having a portfolio makes this simple!</p>
<h2 id="heading-what-should-your-portfolio-include">What Should Your Portfolio Include?</h2>
<p>Your portfolio should include:</p>
<ul>
<li>A heading section with a call to action that introduces yourself</li>
<li>A projects/work section that showcases 3 - 5 of your best projects</li>
<li>A skills section that showcases your technical proficiencies</li>
<li>An about section that has a bit of information about yourself (not too detailed)</li>
<li>A contact section with a form that allows people to directly contact you</li>
<li>A simple navigation to go between pages</li>
<li>A link to your resume and socials (e.g GitHub, LinkedIn etc.)</li>
</ul>
<h3 id="heading-the-header">The Header</h3>
<p>Having a good looking header to your portfolio is important since this is essentially your first impression. I think a good way to go about it is having a dark background image with some contrasting-colour overlaying text that introduces yourself. Keeping it short is  highly beneficial since no one wants to read a full essay on who you are (at least not at the start). </p>
<p>Another important part of your header in a call to action. A call to action is a button or a link that you want visitors to click. This could be a button that links to your work. Or a button that links to your skills. Or even a contact button. The point is its important to have one.</p>
<p>Take a look at the header section of my portfolio:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639029080010/ETcBFxbdB.png" alt="Portfolio Header" /></p>
<p>Its simple and clean. It has a clear navigation at the top of the page that links to the various sections of my portfolio. It has a simple piece of text in the centre that says my name and a short summary of what I do. Finally, there is a call to action that says 'See My Work' that links to the projects section.</p>
<h3 id="heading-the-projects-section">The Projects Section</h3>
<p>The projects section is the most important part of your portfolio. It directly showcases your work. I would suggest range of about 3 to 6 of your best projects that showcase the skills you claim you can do. For each project, its important to have a title, description of what the project is, a list of skills you used to build it and links to a live site and GitHub repository (or wherever the code is). </p>
<p>Keep the description short and sweet to not make anyone bored but make sure you make the project sound impressive. Having an image of your project (or just a part of the project) is also another good addition since it shows what the project looks like.</p>
<p>Take a look at the projects section of my portfolio:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639029421134/qmEOQeCQl.png" alt="Portfolio Projects Section" /></p>
<p>It has a clear heading at the top saying "My Projects". The image only includes the top of the section however below, there are three of my best projects that highlight my skills. For each project, there is a title, description, list of skills, link to code and link to a live demo as well as a screenshot of the project.</p>
<p>If you aren't sure what projects you want to build/add to your portfolio, check out my article on <a target="_blank" href="https://blog.blakeyeboah.com/full-stack-portfolio-projects-you-need-to-build-now">Full Stack Portfolio Projects You Should Build</a>.</p>
<h3 id="heading-the-skills-section">The Skills Section</h3>
<p>The skills section isn't necessary since it would be on your resume however I think it can't hurt to have a short, simple section that lists your skills. Additionally, categorizing these skills (e.g frontend, backend, etc) further clarifies your technical proficiencies and what you can do.</p>
<p>Take a look at the skills section of my portfolio:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639029806221/MVv_lW0f0.png" alt="Portfolio Skills Section" /></p>
<p>Its nice, simple and shows exactly what skills I have in what area.</p>
<h3 id="heading-the-about-section">The About Section</h3>
<p>The about section has one main purpose of answering these questions:</p>
<ul>
<li>Who are you?</li>
<li>What do you do?</li>
<li>Why do you do it?</li>
</ul>
<p>These three W's are the perfect recipe to a good about paragraph. Including an image in your about section is optional. There are negatives since people can discriminate however you probably have an image on your LinkedIn anyway so I don't think it matters. Another part you probably want to include is a links to your social platforms like GitHub and LinkedIn. You can link to other platforms like Instagram if you want but I would only recommend it if its relevant. For example, if you post what you had for dinner last night that probably isn't relevant to a client/employer.</p>
<p>Take a look at the about section of my portfolio:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639030173813/NcxTiqXNK.png" alt="Portfolio About me" /></p>
<p>Its simple and contains everything it needs to do. I decided to add a photo since it improved the aesthetic and improved the layout however this is optional. </p>
<p>Also, remember not to make your about section too long. You don't need to mention every detail in your life, just focus on the good stuff that an employer would be interested in.</p>
<h3 id="heading-the-contact-section">The Contact Section</h3>
<p>The contact section should simply contain a form that lets users send you an email. This makes it really simple for potential clients or employers to get back to you. Another part you may wish to include is your phone number since people may wish to call you instead of emailing back and forth. </p>
<p>Take a look at the contact section of my portfolio:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639030390092/z1OgRXxqu.png" alt="Portfolio Contact Section" /></p>
<p>Its a very simple form which allows visitors to easily send me an email if they wish.</p>
<h2 id="heading-other-tips">Other Tips</h2>
<p>Here are some other tips you may want to take into account when building your portfolio:</p>
<ul>
<li>Design is key: having a good design on your portfolio makes a good impression.</li>
<li>Simplicity: sometimes, simple is best. This is one of those times.</li>
<li>One Page: including all sections on one page tends to work better than multiple since people only have to look at that one page and not be constantly switching between pages to see your information.</li>
</ul>
<h2 id="heading-take-away">Take Away</h2>
<p>This article has covered the various inclusion and exclusions of a good developer portfolio. Good luck in building or improving you portfolio site!</p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Github:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item><item><title><![CDATA[My Favorite Front End Tech Stack]]></title><description><![CDATA[In this article, I will be discussing my favourite front end tech stack including libraries, languages and tools.  I decided to write this article since maybe you might want to try out this tech stack in your own projects or maybe you are looking for...]]></description><link>https://blog.blakeyeboah.com/my-favorite-front-end-tech-stack</link><guid isPermaLink="true">https://blog.blakeyeboah.com/my-favorite-front-end-tech-stack</guid><category><![CDATA[React]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[Redux]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Tailwind CSS]]></category><dc:creator><![CDATA[Blake Yeboah]]></dc:creator><pubDate>Wed, 08 Dec 2021 10:48:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1638959594003/IyBSd-xoK.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I will be discussing my favourite front end tech stack including libraries, languages and tools.  I decided to write this article since maybe you might want to try out this tech stack in your own projects or maybe you are looking for some front end tools to add to your belt.</p>
<h2 id="heading-react">React</h2>
<p>React is the frontend framework i use in the majority of frameworks. If you don't know what React is, it is a frontend library maintained by Facebook for building user interfaces. From hooks to the virtual DOM, React is a great option for building user interfaces. </p>
<h2 id="heading-react-router">React-Router</h2>
<p>React-Router is a must-use package with React since it allows you to setup different routes in your application that would link to different pages. Its really simple to use and has a great developer-experience. </p>
<h2 id="heading-redux">Redux</h2>
<p>My preferred library for state management in React is Redux. Redux has been around for a while and I think its the best option available (at least for larger projects). On smaller projects I either implement the Context API with the <code>useContext</code> hook or I simply use props. With <a target="_blank" href="https://github.com/reduxjs/redux-toolkit">@reduxjs/toolkit</a>, it is incredibly easy to setup (compared to the past) and it also doesn't have too high of a learning curve.</p>
<h2 id="heading-typescript">TypeScript</h2>
<p>TypeScript is great! It allows you to strongly type your JavaScript and can added to react by adding a simple flag to your <code>create-react-app</code> command. TypeScript helps prevent bugs and issues early since it type checks your code and throws more exceptions. I would highly recommend you start using TypeScript in your projects.</p>
<h2 id="heading-tailwind-css">Tailwind CSS</h2>
<p>I recently began using Tailwind CSS and I must admit I've been really enjoying it. Its utility-based approach seemed a bit messy at first however the customization it brings makes up for it. Prototyping user interfaces quickly whilst also building a custom design was quick a pain prior to Tailwind CSS. Its definitely my favourite front end design framework.</p>
<h2 id="heading-react-helmet">React-Helmet</h2>
<p>React helmet is a very helpful package for your React applications since it lets you manipulate the head of the HTML document through your React components. This means that you can change the title of the page dynamically as well as add SEO tags (though not as effective as Next.js SEO).</p>
<h2 id="heading-take-away">Take Away</h2>
<p>This has been my favourite front end tech stack to build application with in 2021. I hope you enjoyed the article. </p>
<p>👌 Thanks for reading this article! </p>
<p>If you like what I do and would love to see more related content, follow me on my other social platforms:</p>
<p><strong>Github:</strong> <a target="_blank" href="https://github.com/Blake-K-Yeboah">Blake-K-Yeboah</a></p>
<p><strong>LinkedIn:</strong> <a target="_blank" href="https://www.linkedin.com/in/blake-yeboah/">Blake Yeboah</a></p>
<p>You can also show your support by buying me a coffee 😃</p>
<p><a href="https://www.buymeacoffee.com/blakeyeboah"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&amp;emoji=&amp;slug=blakeyeboah&amp;button_colour=855ff6&amp;font_colour=ffffff&amp;font_family=Cookie&amp;outline_colour=ffffff&amp;coffee_colour=FFDD00" /></a></p>
]]></content:encoded></item></channel></rss>