<?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: Johnson Francis</title>
    <description>The latest articles on DEV Community by Johnson Francis (@bameejay).</description>
    <link>https://dev.to/bameejay</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%2F400799%2F6fc9b71c-eb87-4796-9f32-8f178c4aeec9.jpg</url>
      <title>DEV Community: Johnson Francis</title>
      <link>https://dev.to/bameejay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bameejay"/>
    <language>en</language>
    <item>
      <title>Follow these Simple Steps to Create a React app Project Using Vite</title>
      <dc:creator>Johnson Francis</dc:creator>
      <pubDate>Thu, 14 Mar 2024 11:34:27 +0000</pubDate>
      <link>https://dev.to/bameejay/follow-these-simple-steps-to-create-a-react-app-project-using-vite-1o45</link>
      <guid>https://dev.to/bameejay/follow-these-simple-steps-to-create-a-react-app-project-using-vite-1o45</guid>
      <description>&lt;p&gt;Creating a React project with the &lt;code&gt;create-react-app&lt;/code&gt; command can be time-consuming for developers. The major benefits of using &lt;code&gt;Vite&lt;/code&gt; are a faster development start and simple configuration. Using either of these approaches will still result in the same intent and objective; however, &lt;code&gt;Vite&lt;/code&gt; is much faster to set up than create-react-app.&lt;/p&gt;

&lt;p&gt;In this article, I will walk you through how to use &lt;code&gt;Vite&lt;/code&gt; to create a React project for faster development. At the end of this guide, you will have a solid understanding of how to create a React app in a much faster way than using the &lt;code&gt;create-react-app&lt;/code&gt; method. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements and Installations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual Studio Code: &lt;a href="https://code.visualstudio.com/download"&gt;Download VS Code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Nodejs: &lt;a href="https://nodejs.org/en/download"&gt;Download Nodejs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Basic understanding of REACTJS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; Locate the folder where you want your React project saved. Click inside the address bar of the folder and enter &lt;code&gt;code .&lt;/code&gt; to open your &lt;code&gt;Visual Studio Code editor&lt;/code&gt;. Navigate your mouse icon to &lt;code&gt;view&lt;/code&gt; from the menu tab, and select &lt;code&gt;terminal&lt;/code&gt; from the drop-down menu.&lt;br&gt;
For Keyboard shortcut, Hold the &lt;code&gt;ctrl key&lt;/code&gt; and &lt;code&gt;tilde key&lt;/code&gt; on your keyboard to open the terminal&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnske7mgm1gfr59ealzu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnske7mgm1gfr59ealzu.PNG" alt="Visual studio code Terminal" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt;  Run  &lt;code&gt;npm create vite@latest vite_reactapp -- -- template react&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;vite_reactapp&lt;/code&gt; is the name you are giving your project. This command creates a new directory named &lt;code&gt;vite-reactapp&lt;/code&gt;, you can give it any name you want. the &lt;code&gt;-- -- template react&lt;/code&gt; specifies that you are creating a React project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwtc2zxriz009t942jfm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwtc2zxriz009t942jfm.PNG" alt="Command to install vite" width="800" height="39"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; &lt;code&gt;cd vite_reactapp&lt;/code&gt; to change from your current directory to a new directory. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwz5rmdeuah8ithwtmts.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwz5rmdeuah8ithwtmts.PNG" alt="Command to change directory" width="800" height="48"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; &lt;code&gt;Run npm install&lt;/code&gt; to install all packages and the necessary dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y5mqdmtkcj87t2llagq.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y5mqdmtkcj87t2llagq.PNG" alt="Install dependencies" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5.&lt;/strong&gt; Run &lt;code&gt;npm run dev&lt;/code&gt; to open and start the local server where you can see your running react application. it's always in this format "&lt;a href="https://localhost/5173"&gt;https://localhost/5173&lt;/a&gt;" which is a default port used by &lt;code&gt;Vite&lt;/code&gt;. if the default is already been used by another application, it will pick the next available port which is usually &lt;code&gt;https://localhost/3000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xxpt5cf7as0pej8ttfk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xxpt5cf7as0pej8ttfk.PNG" alt="Command to start development server" width="800" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, You should have your development webpage look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbdk1x2f9r1znpl7hnq7p.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbdk1x2f9r1znpl7hnq7p.PNG" alt="Localhost webpage" width="500" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What has been your experience creating a react project with &lt;code&gt;vite&lt;/code&gt;, and does it appear to be faster and better than the conventional method?&lt;br&gt;
Please leave your opinions and tips in the comments section below. Let us learn from each other's experiences.&lt;/p&gt;

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