<?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>Forem: Bryan Liao</title>
    <description>The latest articles on Forem by Bryan Liao (@liaob).</description>
    <link>https://forem.com/liaob</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%2F1528800%2F13dcf361-eec8-4032-a518-240384ab7541.png</url>
      <title>Forem: Bryan Liao</title>
      <link>https://forem.com/liaob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/liaob"/>
    <language>en</language>
    <item>
      <title>Building in Public - 5</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Sat, 27 Jul 2024 22:28:58 +0000</pubDate>
      <link>https://forem.com/liaob/building-in-public-5-2i3j</link>
      <guid>https://forem.com/liaob/building-in-public-5-2i3j</guid>
      <description>&lt;p&gt;I added the use of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="noopener noreferrer"&gt;localStorage&lt;/a&gt; to my React project. Since my app is client-only, it felt like the right thing to do to allow some data persistence.&lt;/p&gt;

&lt;p&gt;I created two functions: one to load data from localStorage and another one to add data. The key-value pairing in localStorage is just strings, so I had to use JSON.stringify() and JSON.parse() to manipulate the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{...};&lt;/span&gt;
&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;appData&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;localData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;appData&lt;/span&gt;&lt;span class="dl"&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;localData&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parsedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initially I was calling the add data function in my form submissions, but since I was using React I found it easier to use stick it in &lt;a href="https://react.dev/reference/react/useEffect" rel="noopener noreferrer"&gt;useEffect&lt;/a&gt; instead. Using the existing data as a dependency, I could update localStorage any time it changed.&lt;/p&gt;

&lt;p&gt;I also called my data loading function within useEffect. I used &lt;a href="https://react.dev/reference/react/useRef" rel="noopener noreferrer"&gt;useRef&lt;/a&gt; to &lt;a href="https://stackoverflow.com/questions/53253940/make-react-useeffect-hook-not-run-on-initial-render" rel="noopener noreferrer"&gt;determine the first render&lt;/a&gt; in order to swap between loading previously saved data and updating localStorage when the data changed. Hooray for data persistence 🎉&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>buildinpublic</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Building in Public - 4</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Mon, 22 Jul 2024 02:48:08 +0000</pubDate>
      <link>https://forem.com/liaob/building-in-public-4-npk</link>
      <guid>https://forem.com/liaob/building-in-public-4-npk</guid>
      <description>&lt;p&gt;Continuing my data export journey from last time, I wanted to learn how to copy data to a clipboard. It’s a simple feature, but I always appreciate it when a site has click to copy buttons for code blocks, API keys, etc.&lt;/p&gt;

&lt;p&gt;There’s a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator" rel="noopener noreferrer"&gt;navigator&lt;/a&gt; object within the browser that contains access to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Clipboard" rel="noopener noreferrer"&gt;clipboard API&lt;/a&gt;. Using this API, one can copy designated text to the user’s clipboard (and paste too)! Here’s a simple implementation that I added to my app that utilized the &lt;code&gt;writeText()&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;users&lt;/span&gt;&lt;span class="p"&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;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&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;user1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;321&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&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;user2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;copyDataToClipboard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clipboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;copyButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;copyButton&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;copyButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Copied!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;setTimeout&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="nx"&gt;copyButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Click to copy data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;3000&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'copyButton'&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;copyDataToClipboard&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click to copy data&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s an added bonus that it may feel safer to copy something to your clipboard and paste it into your own text file than to download one directly from a website 🙂&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building in Public - 3</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Fri, 19 Jul 2024 00:31:57 +0000</pubDate>
      <link>https://forem.com/liaob/building-in-public-3-297b</link>
      <guid>https://forem.com/liaob/building-in-public-3-297b</guid>
      <description>&lt;p&gt;I wanted import and exporting files to be the main part of how to save/transfer data around in my app. Since I have previously learned how import works, it’s time to work on export.&lt;/p&gt;

&lt;p&gt;I learned that exporting through the filesystem was only accessible by a server, so my client-only constraint would need a slightly different approach.&lt;/p&gt;

&lt;p&gt;I found a &lt;a href="https://stackoverflow.com/questions/65903776/how-to-read-and-write-to-local-json-files-from-react-js" rel="noopener noreferrer"&gt;workaround solution on StackOverflow&lt;/a&gt; that allowed for creating a downloadable text file link. It’s fairly simple to implement and reuses the concept of using Blobs to represent the data. Personally I think the harder part would be properly validating and parsing through the imported files, depending on how meticulous you want to be.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>Building in Public - 2</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Tue, 11 Jun 2024 04:30:05 +0000</pubDate>
      <link>https://forem.com/liaob/building-in-public-2-i75</link>
      <guid>https://forem.com/liaob/building-in-public-2-i75</guid>
      <description>&lt;p&gt;I haven’t worked with file uploads from scratch before, so I did some exploration.&lt;/p&gt;

&lt;p&gt;Adding a component for file uploads is actually quite simple, it’s adding an &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag with a &lt;code&gt;type="file"&lt;/code&gt; attribute. Through normal browser code, you can access this using &lt;code&gt;document.getElemenyById&lt;/code&gt; and add an event listener to work with the upload. Since I’m using React I used the &lt;code&gt;onChange&lt;/code&gt; attribute and a state hook. &lt;/p&gt;

&lt;p&gt;Something that caught me off guard was the callback. I usually use &lt;code&gt;e.target.value&lt;/code&gt; , but I learned that this will just be a filepath as a String, not the actual file itself. Instead, I had to use the &lt;code&gt;files&lt;/code&gt; property (i.e &lt;code&gt;e.target.files&lt;/code&gt;) to access the FileList from the input element and could read the file contents from that.&lt;/p&gt;

&lt;p&gt;The more you know 🌟&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>Building in Public - 1</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Sat, 08 Jun 2024 01:20:14 +0000</pubDate>
      <link>https://forem.com/liaob/bryan-builds-in-public-1-2kek</link>
      <guid>https://forem.com/liaob/bryan-builds-in-public-1-2kek</guid>
      <description>&lt;p&gt;I’m building a client-only version of Splitwise for fun and practice. One thing that I’m trying to figure out is how to persist data without using a server or database. Some client-based options are &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"&gt;localStorage&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/indexedDB"&gt;indexedDB&lt;/a&gt;, but what if I wanted to collaborate with others or switch computers? At some point, I’d need to save the information somewhere and be able to transfer it somewhere else.&lt;/p&gt;

&lt;p&gt;Taking some inspiration from video games, and something I noticed with &lt;a href="https://github.com/pokeclicker/pokeclicker"&gt;Pokeclicker&lt;/a&gt;, what if it in addition to local storage, I was able to create encoded text files for data? That way I can work locally, save it to my computer or phone, email it elsewhere, etc. Who needs to pay for server hosting 😛&lt;/p&gt;

&lt;p&gt;Something to think about, and something I’m going to explore.&lt;/p&gt;

</description>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>Recovering from burn out by building in public</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Thu, 06 Jun 2024 13:00:00 +0000</pubDate>
      <link>https://forem.com/liaob/recovering-from-burn-out-by-building-in-public-3lb1</link>
      <guid>https://forem.com/liaob/recovering-from-burn-out-by-building-in-public-3lb1</guid>
      <description>&lt;p&gt;Working in big tech really burned me out. &lt;/p&gt;

&lt;p&gt;Honestly I thought I’d have been over it by now having been out of my company for 2 months now, but that doesn’t seem to be the case. Probably not realistic when I was on a slow burn for over a year. What sucks is that I still like programming and building things, at least the idea of it. Problem solving is fun, technology is fun, why aren’t I having any fun using technology to solve problems?&lt;/p&gt;

&lt;p&gt;The weird combination of circumstances that I led me to quit my job made me question a lot of my identity as a developer, but part of why I quit was to work past my previous experienced. &lt;/p&gt;

&lt;p&gt;Therefore, I’m trying something new. As an independent developer I represent myself and I have to keep myself accountable to improving not just my skills but my overall attitude towards programming. I’m starting a “Build in Public” series so I can do both in a more consistent (and public) way. Cheers! 🥂&lt;/p&gt;

</description>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>You should probably have a Bragging Doc</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Mon, 03 Jun 2024 21:27:13 +0000</pubDate>
      <link>https://forem.com/liaob/you-should-probably-have-a-bragging-doc-2d0p</link>
      <guid>https://forem.com/liaob/you-should-probably-have-a-bragging-doc-2d0p</guid>
      <description>&lt;p&gt;Getting a dev job is one thing, but being recognized at that job is another.&lt;/p&gt;

&lt;p&gt;Expanding on the advice of advocating for yourself, it’s important that you keep track of your own accomplishments and contributions to the company. I’ve personally been pretty terrible at keeping track of the work that I’ve done and had trouble showing the “impact” that I’ve had on my team. I had the mentality that my work would speak for itself. &lt;/p&gt;

&lt;p&gt;Silly me, that’s incorrect and a terrible way to think 🙂&lt;/p&gt;

&lt;p&gt;When performance reviews came around I was scrambling to remember everything I had worked on in the past year and talk up how much I was improving the product. There’s also a social aspect of contribution that’s harder to track down.&lt;/p&gt;

&lt;p&gt;Aside from performance reviews, I believe it’s also a good idea to keep a bragging doc handy for when you’re trying to get promoted. At least where I’ve worked, there’s usually some process of collecting proof that you’re performing at the next level. There’s more involvement with your manager, but the idea is similar on your end.&lt;/p&gt;

&lt;p&gt;It may sound like a lot of work to maintain, but it’ll save you a lot of cramming and searching once you start. Future you will thank you. Probably 😛&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Switching to Vite from React-Scripts</title>
      <dc:creator>Bryan Liao</dc:creator>
      <pubDate>Mon, 27 May 2024 04:19:34 +0000</pubDate>
      <link>https://forem.com/liaob/switching-to-vite-from-react-scripts-2bln</link>
      <guid>https://forem.com/liaob/switching-to-vite-from-react-scripts-2bln</guid>
      <description>&lt;p&gt;I have a silly react project that I’m working on that I made using &lt;a href="https://create-react-app.dev/"&gt;create-react-app&lt;/a&gt;. By default, these kinds of projects build and run using &lt;a href="https://github.com/facebook/create-react-app/tree/main/packages/react-scripts"&gt;react-scripts&lt;/a&gt; which uses webpack &lt;a href="https://github.com/facebook/create-react-app/blob/main/packages/react-scripts/scripts/build.js"&gt;under the hood&lt;/a&gt; for building projects. &lt;a href="https://vitejs.dev/"&gt;Vite&lt;/a&gt; is generally known to be faster than Webpack ⚡ so I was curious about how to swap them.&lt;/p&gt;

&lt;p&gt;Installation is simple enough, there’s two dev dependency modules that need to be included:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/vite"&gt;Vite&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/@vitejs/plugin-react"&gt;Vite’s React Plugin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To utilize Vite, start by creating a &lt;code&gt;vite.config.js&lt;/code&gt; file. Here’s a very basic example of what I added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@vitejs/plugin-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;react&lt;/span&gt;&lt;span class="p"&gt;()].&lt;/span&gt;
    &lt;span class="na"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since Vite uses &lt;code&gt;index.html&lt;/code&gt;  as the entry point for the application, I moved it out of my &lt;code&gt;public&lt;/code&gt; folder and into my &lt;code&gt;src&lt;/code&gt; folder. I removed the &lt;code&gt;%PUBLIC_URL%&lt;/code&gt; part from my HTML file and added a script to point to where my react root was created:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;script type='module' src='./index.tsx'&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;All that’s left is to replace the scripts in &lt;code&gt;package.json&lt;/code&gt; to use &lt;a href="https://vitejs.dev/guide/cli.html"&gt;vite commands&lt;/a&gt; instead and remove &lt;code&gt;react-scripts&lt;/code&gt;  as a dependency. 🎉&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>vite</category>
    </item>
  </channel>
</rss>
