<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tochukwu John</title>
    <description>The latest articles on DEV Community by Tochukwu John (@xeuxdev).</description>
    <link>https://dev.to/xeuxdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F769926%2Fc3a1a404-0238-472d-ae76-4b4e02ef6f22.jpg</url>
      <title>DEV Community: Tochukwu John</title>
      <link>https://dev.to/xeuxdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xeuxdev"/>
    <language>en</language>
    <item>
      <title>How To Make Your Website Faster 🔥🚀🚀</title>
      <dc:creator>Tochukwu John</dc:creator>
      <pubDate>Sat, 04 Nov 2023 09:27:58 +0000</pubDate>
      <link>https://dev.to/xeuxdev/how-to-make-your-website-faster-384n</link>
      <guid>https://dev.to/xeuxdev/how-to-make-your-website-faster-384n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kj82h642dv370i9zfmh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kj82h642dv370i9zfmh.jpg" alt="Speed up your website" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
Don't you find it frustrating when a website takes an eternity to load, or when it finally does, crucial elements are mysteriously absent? Doesn't it evoke a sense of annoyance? Well, personally, I can't help but feel that way.&lt;/p&gt;

&lt;p&gt;According to google, an optimal page load time falls within the range of 0 to 2 seconds, with 3 seconds also being deemed acceptable. Anything exceeding 3 seconds significantly elevates the chances of visitors exiting your website. Quite the eye-opener, isn't it?&lt;/p&gt;

&lt;p&gt;In this article, I'll present several methods to enhance the speed of &lt;em&gt;your&lt;/em&gt; website. By the end, I'll also provide an example.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Disclaimer&lt;/code&gt;: The following statements represent my personal opinions. Although they may contain factual information, their validity largely hinges on various contextual factors.&lt;/p&gt;




&lt;p&gt;Just like many endeavors, achieving a goal involves a series of steps, and here are some (though not all) that I prefer to follow when striving to enhance website speed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identifying the performance bottlenecks.&lt;/li&gt;
&lt;li&gt;Optimize the performance bottlenecks.&lt;/li&gt;
&lt;li&gt;Remove unnecessary scripts, assets, animations and other superfluous elements .&lt;/li&gt;
&lt;li&gt;Caching, optimizing queries / rendering processes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Identifying the performance bottlenecks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Immediately you notice your site being slow, you would want to trouble shoot to discover what’s making it slow right? Well yes that’s the first step. To effectively troubleshoot you’ll need some tools, the ones I like to use are &lt;code&gt;Chrome's lighthouse&lt;/code&gt;, &lt;a href="https://pagespeed.web.dev/" rel="noopener noreferrer"&gt;PageSpeed&lt;/a&gt;, &lt;a href="https://www.webpagetest.org/" rel="noopener noreferrer"&gt;webpage test&lt;/a&gt; and the networks tab in the browser dev tools. In the networks tab, look for the responses with large waterfalls, those are the slow ones, with &lt;code&gt;webpagetest&lt;/code&gt; you get a full report and how you can improve. &lt;br&gt;
For a comprehensive understanding of the issues, it's advisable to conduct scans multiple times to ensure accuracy, this would help you identify what assets, scripts are causing the slow loads. In my experience, the primary culprits for poor performance often include large unoptimized images, excessive / unoptimized fonts, unused scripts, and occasionally, inefficient re-rendering practices. Now that you’ve identified all the performance bottlenecks we can proceed to optimizing them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Optimizing the performance bottlenecks.&lt;/strong&gt;&lt;br&gt;
Here, it is essential to create a priority list, as some aspect of the bottlenecks may be slow, and there may be limitations on what can be improved. In my opinion your first approach should be to optimize the static images in the website so that your website has a good &lt;code&gt;First Contentful Paint (FCP)&lt;/code&gt; and &lt;code&gt;Largest Contentful Paint (LCP)&lt;/code&gt; metric. In my opinion no static image should exceed 200kb at most, compress them as much as possible. In this regard, Opting for image formats such as &lt;code&gt;.webp&lt;/code&gt; or &lt;code&gt;.avif&lt;/code&gt; is adviceable as they offer smaller sizes while preserving a reasonable level of quality. I recommend &lt;code&gt;.webp&lt;/code&gt; due to better browser support, Once you've completed these steps, you should begin to notice improvements.&lt;br&gt;
To further enhance your site's performance, consider implementing lazy loading for your remote images. If you're concerned about layout shifts, employ a skeleton or placeholder while waiting for the images to load. &lt;br&gt;
The next priority should be optimizing your fonts since they necessitate additional requests, downloads, parsing and rendering time. If you have locally hosted fonts, it's a good practice to compress them and ensure they can be cached effectively through a Content Delivery Network (CDN) during deployment. If you’re using services like &lt;a href="https://fonts.google.com/" rel="noopener noreferrer"&gt;&lt;code&gt;Google Fonts&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://www.cdnfonts.com/" rel="noopener noreferrer"&gt;&lt;code&gt;cdn fonts&lt;/code&gt;&lt;/a&gt;, you should consider preloading them, but be cautious not to preload all fonts as you may lose the gains you are aiming for. Only preload the essential fonts and ensure they match the fonts specified in your CSS file.&lt;br&gt;
Optimizing scripts can be a complex and time-consuming task, but it's crucial, especially when dealing with business logic. Neglecting this aspect can lead to some rather humorous (or not-so-humorous) consequences!. One thing you can do is to minify your scripts, I am not going to say refactor because less code does not mean more performance, else python would be faster than C++ or rust. This phase may occasionally require a reevaluation of the logic or its implementation, potentially leading to a rewrite in a more performance-oriented language or runtime. However, caution is essential when undertaking such a task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Remove unnecessary scripts, assets, animations and other stuffs .&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This step is also crucial because there might be scripts and assets on your website that serve no purpose, yet you've unintentionally left them in place. Consequently, they are also downloaded by the browser increasing load times. Addressing the animations aspect can be tricky. Most times, the performance hit is as a result of the implementation and excessive usage, especially when you're using a package that requires &lt;code&gt;JavaScript&lt;/code&gt; to execute animations. Animations possess the power to either enhance or diminish your site's overall quality. When applied thoughtfully, they elevate the UI and UX. Otherwise, they can make your site feel buggy and considerably annoying. So, why wait? Remove all those superfluous animations now! They're simply not adding any value. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Caching, optimizing queries / rendering processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that you’ve successfully identified, optimized and removed unnecessary stuffs from your site. You can take your optimization efforts even further by refining your data fetching logic and scripts. In this context, caching plays an important role. Additionally, consider implementing loading states into your website to enhance the user experience. When deploying your site, choose a fast server with CDN capabilities to further improve performance. You might want to consider deploying to the &lt;code&gt;edge&lt;/code&gt; for extra performance boost. However, do keep in mind that not all Node.js APIs are supported in this context, which can be a limitation. Optimizing queries / query response times involves minimizing latency. One effective way to do this is by ensuring that your server and database are physically close to each other or in the same region. This proximity reduces cold starts and minimizes the back-and-forth read and write operations, ultimately enhancing performance.&lt;br&gt;
Another valuable practice is to cache assets and data that don't frequently change. This strategy allows your users to be served cached data, resulting in faster load times.&lt;br&gt;
Lastly, If your server suffers from slow cold start times, consider setting up a cron job to periodically send requests to your server. This approach keeps your server "warm" and ensures it can respond promptly to requests without the delay associated with cold starts.&lt;/p&gt;

&lt;p&gt;Whew!! I promised to show you an example 😊.&lt;br&gt;
Well in this example the original site was built with &lt;code&gt;Nuxt&lt;/code&gt; but mine was built with just &lt;code&gt;Vuejs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On the original the performance was just outright bad with excessive bandwidth consumption.&lt;br&gt;
A total of &lt;code&gt;89&lt;/code&gt; requests were made resulting in the download of &lt;code&gt;19.6mb&lt;/code&gt; of resources and the page completed loading in &lt;code&gt;44.07sec&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;For my site, we have a total of 27 requests, resulting in the download of 547KB of resources, and the page completes loading in just 2.05 seconds.&lt;/p&gt;

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

&lt;p&gt;I could go further but I'm lazy&lt;/p&gt;

&lt;p&gt;Here are the lighthouse scores&lt;/p&gt;

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

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

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

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

&lt;p&gt;Here's the link to the websites&lt;br&gt;
original - &lt;a href="https://www.axia.africa/" rel="noopener noreferrer"&gt;&lt;code&gt;Original&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
Optimised - &lt;a href="https://axia-africa.vercel.app/" rel="noopener noreferrer"&gt;&lt;code&gt;Optimised&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Absolutely, optimizing for speed is paramount. Avoid subjecting your visitors to a slow and frustrating user experience. Prioritize speed to guarantee a smoother and more enjoyable user journey. 🚀🚀&lt;/p&gt;

&lt;p&gt;Happy coding 🚀 and bulaba 👍✌️&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Sharing Layouts with NextJS 13 app dir</title>
      <dc:creator>Tochukwu John</dc:creator>
      <pubDate>Tue, 27 Jun 2023 22:26:10 +0000</pubDate>
      <link>https://dev.to/xeuxdev/sharing-layouts-with-nextjs-13-app-dir-3374</link>
      <guid>https://dev.to/xeuxdev/sharing-layouts-with-nextjs-13-app-dir-3374</guid>
      <description>&lt;p&gt;Hey there 👋👋 my fellow NextJS devs 💪, so While I was working on my side project, I noticed something about the new NextJS 13 app dir. I was like since routes can share layouts, what if I could a share layout for certain routes without affecting the URL? 🤔. I was sure this wasn’t possible till I visited the docs and found an interesting section on route-groups 😇😊.&lt;/p&gt;

&lt;p&gt;So basically, this allows you to define multiple routes by wrapping a folder's name in parenthesis: (folderName) and as a result when you define a layout.js/tsx for this folder, all sub folders/routes would inherit and share the layout. 😲😲&lt;/p&gt;

&lt;p&gt;More info here - &lt;a href="https://nextjs.org/docs/app/building-your-application/routing/route-groups" rel="noopener noreferrer"&gt;Route Groups | Next.js&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is especially useful if you have several segments of your site that share similar layouts. Instead of repeating layouts everywhere 🤦‍♂️, you can make use of a route group instead.&lt;/p&gt;

&lt;p&gt;To showcase this, I've gone ahead to create a demo-app, you can find the GitHub repo here: &lt;a href="https://github.com/xeuxdev/route-group" rel="noopener noreferrer"&gt;Github - Route Group&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the &lt;code&gt;app folder&lt;/code&gt;&lt;br&gt;
I added two route-groups&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;onboarding&lt;/li&gt;
&lt;li&gt;authenticated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each with it’s own routes&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsl9ebsb01wxrqhcf5hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsl9ebsb01wxrqhcf5hn.png" alt="Routes " width="272" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the route-group folders, there is a &lt;strong&gt;layout.tsx&lt;/strong&gt; file bearing the layout that would be shared by all the routes in the folder, which means components that are placed in the &lt;strong&gt;layout.tsx&lt;/strong&gt; files are not re-rendered when navigating across pages.&lt;/p&gt;

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

&lt;p&gt;From the code snippet above, the &lt;code&gt;&amp;lt;Navigation/&amp;gt;&lt;/code&gt; component would not be re-rendered when navigating and would maintain its state when navigating.&lt;/p&gt;

&lt;p&gt;To further prove this I added a &lt;code&gt;&amp;lt;RouteProof /&amp;gt;&lt;/code&gt; component to the (authenticated) layout.&lt;/p&gt;

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

&lt;p&gt;The &lt;code&gt;&amp;lt;RouteProof /&amp;gt;&lt;/code&gt; is just a component that animates up and down, and since it is in the &lt;code&gt;layout.tsx&lt;/code&gt; file it is not re-rendered on page navigation.&lt;/p&gt;

&lt;p&gt;To view this in full. Here's the deployed site URL: &lt;a href="https://route-group.vercel.app" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;P.S: the site is not responsive as this is just a demo. 😊&lt;/p&gt;

&lt;p&gt;happy coding 🚀🚀&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>nextjs</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>How to Deploy Your React App to Vercel.</title>
      <dc:creator>Tochukwu John</dc:creator>
      <pubDate>Tue, 14 Mar 2023 15:02:40 +0000</pubDate>
      <link>https://dev.to/xeuxdev/how-to-deploy-your-react-app-to-vercel-1lej</link>
      <guid>https://dev.to/xeuxdev/how-to-deploy-your-react-app-to-vercel-1lej</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0jr2ojjft09omz1v6a8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0jr2ojjft09omz1v6a8.png" alt="Deploying React app" width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
So you have built your project, whatever it may be, using React, and feeling confident, you decide to deploy it and show it to the world😊. But you have no idea how to do that?🤔.&lt;br&gt;
In this article, you will learn just that.&lt;br&gt;
There are numerous options available for hosting your React app, including but not limited to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;&lt;br&gt;
&lt;a href="https://pages.github.com/" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt;&lt;br&gt;
&lt;a href="https://render.com/" rel="noopener noreferrer"&gt;Render&lt;/a&gt; and so on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we'll focus solely on &lt;strong&gt;Vercel&lt;/strong&gt;, based on my personal experience, it's the best and most user-friendly option.&lt;br&gt;
So, let's dive into it!😊&lt;/p&gt;

&lt;p&gt;To deploy your React App to Vercel, simply follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Head over to Vercel's sign up page &lt;a href="https://vercel.com/signup" rel="noopener noreferrer"&gt;Here&lt;/a&gt;. Once you arrive, you will see a page similar to the one below&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As a beginner, simply click on 'Hobby', enter your name or preferred alias, and click on 'Continue' as demonstrated below.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;After doing that, You will be prompted to choose your &lt;strong&gt;Git&lt;/strong&gt; provider or to continue with your Email as shown below.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Go ahead and click on 'Connect to GitHub', 'GitLab', or 'Bitbucket'. Since we'll be using GitHub, proceed to click on '&lt;strong&gt;Continue with GitHub&lt;/strong&gt;'. You should then see a pop-up similar to this&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you already have a GitHub account, proceed to sign in. If not, go ahead and create an account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After signing in, you will be redirected to your Vercel Dashboard, which will look something like this. However, since you are a new user, your dashboard will be empty.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;To get started, click on the &lt;strong&gt;Add New&lt;/strong&gt; button, which will display a dropdown menu. From there, select &lt;strong&gt;Project&lt;/strong&gt;. This will take you to a new page where you can view all the projects in your GitHub repository, as shown below. &lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;After clicking on 'Import', you will be taken to a new page where you can configure your deployment settings. However, Vercel is so awesome that it automatically configures everything for you, including your framework, so you don't have to worry about it.
Just go ahead and click on deploy as shown below.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Clicking on 'Deploy' will initiate the deployment process automatically. Please wait for it to complete. Once it's done, you'll be redirected to a page that displays a congratulatory message, along with a preview of how your page looks. Click on the preview, and you'll be taken to your project's Live site.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations 🚀🚀🎊🎉🎉, you have successfully deployed your project to Vercel. It's time to show off your hard work to the world! 😋🚀 &lt;/p&gt;

&lt;p&gt;Like what you just read? Follow me on &lt;a href="https://twitter.com/Headbwoi_1" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to remove duplicate elements in an Array in JavaScript.</title>
      <dc:creator>Tochukwu John</dc:creator>
      <pubDate>Thu, 23 Feb 2023 23:22:40 +0000</pubDate>
      <link>https://dev.to/xeuxdev/how-to-remove-duplicate-elements-in-an-array-in-javascript-3kb7</link>
      <guid>https://dev.to/xeuxdev/how-to-remove-duplicate-elements-in-an-array-in-javascript-3kb7</guid>
      <description>&lt;p&gt;So I came across this problem where I had an array consisting of multiple elements in the array and some elements were duplicated. After much research and brain-storming, I found 3 ways to remove duplicate elements from an array. &lt;br&gt;
They are: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;using &lt;strong&gt;forEach()&lt;/strong&gt; with the &lt;strong&gt;includes()&lt;/strong&gt; array methods.&lt;/li&gt;
&lt;li&gt;using &lt;strong&gt;filter()&lt;/strong&gt; with the &lt;strong&gt;indexOf()&lt;/strong&gt; methods.&lt;/li&gt;
&lt;li&gt;using &lt;strong&gt;Set()&lt;/strong&gt; method.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's get started and get our hands dirty and see how we can do this😊:&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;1.) Using forEach() method with the includes() method&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;forEach&lt;/strong&gt; method iterates over an array and calls a function on each element in the array. It is not executed for empty elements.&lt;br&gt;
The &lt;strong&gt;includes()&lt;/strong&gt; method returns &lt;code&gt;true&lt;/code&gt; if an array contains a specified value. It returns &lt;code&gt;false&lt;/code&gt; if the value is not found. Therefore, it is case sensitive.&lt;br&gt;
So how do we combine them to do what we want i.e. remove duplicate elements?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;first let's declare an array and put duplicate elements in it.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;let's declare another array that would hold the unique values&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;let's run our loop&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
        &lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;OR&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here's our Output&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both of them produces the same result. The first one pushes elements into the cleanArray variable only when the &lt;strong&gt;includes()&lt;/strong&gt; method evaluates to &lt;code&gt;false&lt;/code&gt; while in the second, the &lt;code&gt;return&lt;/code&gt; stops the execution of the element when true and only pushes elements that evaluates to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2.) Using the filter() method with indexOf() method&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;filter()&lt;/strong&gt; method creates a new array filled with elements that pass a test provided by a function. It does not execute the function for empty elements, and it does not change the original array, rather it creates a new array from the original array.&lt;br&gt;
The &lt;strong&gt;indexOf()&lt;/strong&gt; method returns the first index (position) of a specified value. It returns -1 if the value is not found. It starts from a specified index and searches from left to right.&lt;br&gt;
So let's see how we can do this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;we define our testArray, then we use the &lt;strong&gt;filter()&lt;/strong&gt; method to get the elements whose indexes match their indexOf values, since &lt;strong&gt;filter()&lt;/strong&gt; returns a new array we can capture it in our cleanArray variable.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here's our Output&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;But what if we want to get the duplicate instead?&lt;br&gt;
Just modify our condition to get the elements whose indexes does not match their indexOf values, e.g.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;And we will get the duplicates as our Output&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;3.) Using the JavaScript Set()&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A JavaScript Set is a collection of unique values. Each value can only occur once in a set. Thus, it can hold any value of any data type.&lt;br&gt;
To do this, we need to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Define our testArray, and call the &lt;strong&gt;Set()&lt;/strong&gt; method on the testArray but oops that results in an Object not an Array😔 as shown below.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//Set { 'hey', 'hello', 'hola' }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;To fix this, we can use two ways which are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;spread the new Set() in an array
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//[ 'hey', 'hello', 'hola' ]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;OR&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use the Array constructor to generate an array from the Set() method
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;testArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hola&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;cleanArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testArray&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cleanArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//[ 'hey', 'hello', 'hola' ]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to pick any method that works for you and satisfies your needs. Personally, I prefer to use Set because the other two are basically calling a for loop in a for loop which heavily increases how long the algorithms are going to take and using the set() method is slightly faster. &lt;br&gt;
There may be other ways to do this though😊.&lt;/p&gt;

&lt;p&gt;if you like such content follow me on twitter &lt;a href="https://twitter.com/Headbwoi_1" rel="noopener noreferrer"&gt;@Headbwoi&lt;/a&gt;&lt;br&gt;
Thank You. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Getting started with React.js with Typescript using vite.js⚡</title>
      <dc:creator>Tochukwu John</dc:creator>
      <pubDate>Sun, 19 Feb 2023 02:08:49 +0000</pubDate>
      <link>https://dev.to/xeuxdev/getting-started-with-reactjs-with-typescript-using-vitejs-hjo</link>
      <guid>https://dev.to/xeuxdev/getting-started-with-reactjs-with-typescript-using-vitejs-hjo</guid>
      <description>&lt;p&gt;In 2023, React is still one of the best ways to build user interfaces, despite all the frameworks that have pop up in the last few months promising performance improvements and good Developer experience, React still remains the OG, the King of UI because of its ginormous community, ease of use, the fact that it is "just JavaScript", unlimited supporting packages and integrations that still makes it the go to means for building user interfaces in 2023🔥. That was a lot to take in right? 😊&lt;br&gt;
So let's get started by learning what these technologies are😊.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;what is React?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;React is a JavaScript library for building interactive user interfaces Developed by Facebook and maintained by it's awesome open-source community members. In React, there are two ways of writing React code, Using the infamous Class Components or the beloved Functional Components, the latter is the recommended way of using React by the docs &lt;a href="https://beta.reactjs.org/" rel="noopener noreferrer"&gt;React Docs&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;what is TypeScript?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. It helps you to catch silly bugs that can break your code in production, it adds a strongly typed system on top of JavaScript resulting in more lines of code but it helps a lot with code maintenance and readability.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;what is Vite?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Vite (the French word for "quick", pronounced &lt;code&gt;/vit/&lt;/code&gt;, like "veet") is a &lt;strong&gt;build&lt;/strong&gt; &lt;strong&gt;tool&lt;/strong&gt; that provides a faster and leaner development experience for modern web projects. It consists of two major parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A dev server that provides &lt;a href="https://vitejs.dev/guide/features.html" rel="noopener noreferrer"&gt;&lt;strong&gt;rich feature enhancements&lt;/strong&gt;&lt;/a&gt; over &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules" rel="noopener noreferrer"&gt;&lt;strong&gt;native ES modules&lt;/strong&gt;&lt;/a&gt;, for example extremely fast &lt;a href="https://vitejs.dev/guide/features.html#hot-module-replacement" rel="noopener noreferrer"&gt;&lt;strong&gt;Hot Module Replacement (HMR)&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A build command that bundles your code with &lt;a href="https://rollupjs.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Rollup&lt;/strong&gt;&lt;/a&gt;, pre-configured to output highly optimized static assets for production.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vite doesn't need to bundle the entire app or transpile the modules and code before starting a dev server; transpiling is done on-demand, thus making it &lt;strong&gt;significantly faster&lt;/strong&gt; than CRA.&lt;br&gt;
In Conclusion, Vite is faster, lighter and more enjoyable than other build tools for React.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;To get started with React and Typescript with Vite, you will have to pass some requirements.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Good knowledge of ES6+ syntax and logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you know your way around JavaScript i.e. you have built 2 or more projects such as Todo App, Movies App or any app that consumes an API and displays things on the page based on certain conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have Node.js installed on your computer. from v17.0.0 upwards. To download Node.js go to &lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;Nodejs Site&lt;/a&gt; and download the LTS (Long Term Support) version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A node package manager either NPM, Yarn or Pnpm will work perfectly. The preferred version of NPM should be v8.1.0 and above.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have checked these requirements, you can now follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, open your terminal. on windows, type 🪟 + R then type cmd on the popup and click enter, that will open up a terminal to your root directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the folder you want to create your app in. once you are there, then type in the following command:&lt;/p&gt;

&lt;p&gt;with NPM:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;with yarn:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn create vite
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;with PNPM:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm create vite```

&lt;/code&gt;&lt;/pre&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click enter to proceed. you will be prompted to enter the name of the project. enter the name of your choice e.g. "my-project-name" .&lt;/p&gt;

&lt;p&gt;when you've done that, click enter.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;it will ask you to select a framework, use the arrow keys to move up and down and enter to select.&lt;/li&gt;
&lt;li&gt;Select React, then select Typescript&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;it will scaffold your project.&lt;/p&gt;

&lt;p&gt;Now you can run the following commands:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;4.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-project-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;moves you into "my-project-name" folder where the app was created.&lt;/p&gt;

&lt;p&gt;5.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;installs all the files and dependencies of React and Typescript.&lt;/p&gt;

&lt;p&gt;6.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;starts the application in development mode&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can now edit the &lt;code&gt;App.tsx&lt;/code&gt; file with the code editor of your choice and instantly see your changes in the browser without refreshing thanks to the Hot Module Replacement (HMR) built into Vite .&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that is how you setup React with Typescript using Vite⚡.&lt;/p&gt;

&lt;p&gt;Thanks you.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>a11y</category>
    </item>
  </channel>
</rss>
