<?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: Tarun Singh</title>
    <description>The latest articles on DEV Community by Tarun Singh (@tarunsingh).</description>
    <link>https://dev.to/tarunsingh</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%2F496007%2Fba0b0628-3db4-42c2-90f9-61eb0f9c143e.jpeg</url>
      <title>DEV Community: Tarun Singh</title>
      <link>https://dev.to/tarunsingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tarunsingh"/>
    <language>en</language>
    <item>
      <title>Server-side rendering(SSR) with React[Part-2] </title>
      <dc:creator>Tarun Singh</dc:creator>
      <pubDate>Wed, 11 Aug 2021 11:48:18 +0000</pubDate>
      <link>https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-2-gin</link>
      <guid>https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-2-gin</guid>
      <description>&lt;p&gt;Hello folks 👋, In this article, you'll learn how you can actually server-side render a React App. &lt;br&gt;
This is Part 2 of &lt;a href="https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h"&gt;Server-side rendering(SSR) with React[Part-1]&lt;/a&gt;. It is recommended that you go through &lt;a href="https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h"&gt;Part 1&lt;/a&gt; of this article and while you're there don't forget to leave your thoughts. :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Article mirrors&lt;/strong&gt;&lt;br&gt;
Read in your preferred platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tarunsingh.hashnode.dev/server-side-renderingssr-with-reactpart-2" rel="noopener noreferrer"&gt;hashnode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Quick Recap
&lt;/h2&gt;

&lt;p&gt;As we saw in &lt;a href="https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h"&gt;Part 1&lt;/a&gt; though SSR solves the problem that client-side rendered app faces like &lt;strong&gt;initial load time&lt;/strong&gt; and with &lt;strong&gt;SEO&lt;/strong&gt; it had its own drawbacks. Every time we visit a new page of our website, frequent requests are made to the server and our app render from the ground up.&lt;br&gt;&lt;br&gt;
Now, we'll discuss how we can solve this issue by &lt;strong&gt;SSR with React&lt;/strong&gt;. Let's go straight on it.&lt;/p&gt;
&lt;h2&gt;
  
  
  SSR with React
&lt;/h2&gt;

&lt;p&gt;We can have the best of both the worlds with the introduction of SSR with React.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The idea is to render our app initially from the server and then leverage the advantages of Single Page Applications(SPAs) at the client-side.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;SPAs are fast and provide us with a good user experience. Therefore, we can render our app on the server initially and then from there on run our app as a SPA. Thus, apps rendered this way are called &lt;strong&gt;Universal Apps&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Applications that have the ability to render both on the server and the client are called &lt;strong&gt;universal apps.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;SSR + SPAs = Universal Apps&lt;/p&gt;

&lt;p&gt;Now we enjoy the following benefits :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast load time on &lt;strong&gt;initial render&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Web crawlers can index our page ensuring &lt;strong&gt;SEO&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Also, we now can leverage the advantages that SPAs offer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Some React methods that help us in SSR
&lt;/h2&gt;

&lt;p&gt;Let's first look at the method that will be helping us to create our &lt;strong&gt;Universal App&lt;/strong&gt; or &lt;strong&gt;Isomorphic React App&lt;/strong&gt;, another term for such apps.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;hydrate()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;react-dom&lt;/code&gt; package provides us with &lt;code&gt;hydrate()&lt;/code&gt; method that is used to combine SSR and client-side  rendering.  &lt;br&gt;&lt;br&gt;
This is what React docs says about &lt;code&gt;hydrate()&lt;/code&gt;,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Same as render(), but is used to hydrate a container whose HTML contents were rendered by &lt;code&gt;ReactDOMServer&lt;/code&gt;. React will attempt to attach event listeners to the existing markup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's first look what &lt;code&gt;ReactDOMServer&lt;/code&gt; is.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;ReactDOMServer&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;As per the react docs,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The ReactDOMServer object enables you to render components to static markup. Typically, it’s used on a Node server.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;ReactDOMServer.renderToString()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Now what's this I know it's getting a bit confusing but trust me they are just methods provided by react to work with SSR. &lt;strong&gt;I'll be summarizing all this after this last method that you should know.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again let's see what our dear friend says. As per React docs,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Render a React element to its initial HTML. React will return an HTML string. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay enough, so now you have some idea of what this above method does, let's summarize.&lt;/p&gt;
&lt;h2&gt;
  
  
  Our Goal
&lt;/h2&gt;

&lt;p&gt;Our aim is to render the initial page directly from our server i.e server-side render our initial requests and then from thereon once we have successfully loaded our initial page we can continue using our client-side app. Therefore, we can set up our &lt;strong&gt;Universal (or Isomorphic) App&lt;/strong&gt; this way ensuring &lt;strong&gt;faster initial load&lt;/strong&gt; as required.&lt;/p&gt;

&lt;p&gt;We'll render our &lt;code&gt;App.js&lt;/code&gt; component from the server and since this is a react component we require &lt;code&gt;React&lt;/code&gt; and &lt;code&gt;ReactDOMServer&lt;/code&gt;  at the server-side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal is to create a static HTML file inside a build folder(we'll see that how later) and serve that file from the server using the express application.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Next, invoke the &lt;code&gt;renderToString()&lt;/code&gt; method on ReactDOMServer. As mentioned above, &lt;code&gt;ReactDOM.renderToString()&lt;/code&gt; will return a HTML string. At the server-side we'll then be sending this HTML markup to render and &lt;code&gt;React.hydrate&lt;/code&gt; will be waiting for this server-side rendered HTML markup.&lt;/p&gt;

&lt;p&gt;A little more clear, huh but now let's solidify the concept.&lt;/p&gt;
&lt;h2&gt;
  
  
  SSR in practice
&lt;/h2&gt;

&lt;p&gt;We'll be making a simple Pokemon Database app where you can search for your favorite pokemon. We'll only focus on setting up the SSR with React. The entire source code can be found &lt;a href="https://github.com/tarunsinghdev/ssr-with-react/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1628665865289%2FScxr9RJrVC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1628665865289%2FScxr9RJrVC.png" alt="pokemon-database.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Excited? let's continue.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1 : Project Setup
&lt;/h3&gt;

&lt;p&gt;First things first, let's install our &lt;code&gt;create-react-app&lt;/code&gt; and clean up the boiler-plate code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app ssr-with-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we need a server. Let's install &lt;code&gt;express&lt;/code&gt;.&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 express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2 : In &lt;code&gt;index.js&lt;/code&gt; file change &lt;code&gt;ReactDOM.render()&lt;/code&gt; to &lt;code&gt;ReactDOM.hydrate()&lt;/code&gt;.
&lt;/h3&gt;

&lt;p&gt;This tells react to render HTML markup coming from the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;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;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;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&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;react-dom&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./index.css&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;App&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;./App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hydrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&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;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;root&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;h3&gt;
  
  
  Step 3 : Working at the server-side
&lt;/h3&gt;

&lt;p&gt;We're now left to setup our server-side code. &lt;br&gt;
Create a &lt;code&gt;server.js&lt;/code&gt; file where we'll setup our server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;initialRenderRoutes&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;./routes/initialRenderRoutes.js&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;path&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;path&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;express&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;express&lt;/span&gt;&lt;span class="dl"&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;^/$&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialRenderRoutes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../build&lt;/span&gt;&lt;span class="dl"&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;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&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="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="s2"&gt;`Server running on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's examine the code. The first line imports &lt;code&gt;initialRenderRoutes.js&lt;/code&gt;. I like to split my code following &lt;strong&gt;MVC&lt;/strong&gt; architecture.  &lt;br&gt;&lt;br&gt;
In &lt;code&gt;initialRenderRoutes.js&lt;/code&gt; we have,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&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;express&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;initialRenderController&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;../controller/initialRenderController.js&lt;/span&gt;&lt;span class="dl"&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;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialRenderController&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="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;So it's pretty simple, if you have worked with an express app, though it wasn't necessary to split up the code but personally I prefer &lt;strong&gt;MVC&lt;/strong&gt; architecture.&lt;/p&gt;

&lt;p&gt;Now in &lt;code&gt;initialRenderRoutes.js&lt;/code&gt; I've imported &lt;code&gt;initialRenderController.js&lt;/code&gt; where our whole logic lies, again done to follow the industry standards.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fs&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;fs&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;path&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;path&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;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;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOMServer&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;react-dom/server&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;App&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;../../src/App.js&lt;/span&gt;&lt;span class="dl"&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;initialRenderController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&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;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;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../client/build/index.html&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;utf8&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="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&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;err&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Internal Server Error&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s2"&gt;`&amp;lt;div id="root"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ReactDOMServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;renderToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/div&amp;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="p"&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="nx"&gt;initialRenderController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Ok so now coming back to our &lt;code&gt;server.js&lt;/code&gt; file we serve our static files with the following line,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../build&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;Now comes the interesting part. Now as you might have noticed the logic in &lt;code&gt;initialRenderController.js&lt;/code&gt; we're first &lt;strong&gt;reading&lt;/strong&gt; our index.html file from our build folder(and to be clear it'll will be generated via &lt;code&gt;npm run build&lt;/code&gt; command, we'll discuss this later) and then we&lt;br&gt;
send the HTML markup pre-rendered. Below code in &lt;code&gt;initialRenderController.js&lt;/code&gt; demonstrates that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="p"&gt;...&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s2"&gt;`&amp;lt;div id="root"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ReactDOMServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;renderToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/div&amp;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;As you can clearly see we're replacing the content of our &lt;code&gt;index.html&lt;/code&gt; with the &lt;strong&gt;HTML markup&lt;/strong&gt;.&lt;br&gt;
So in this way, we have our app that comes pre-rendered from our server, and by now you know the advantages of loading initial HTML requests from the server.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4 : Managing our entry point to the server
&lt;/h3&gt;

&lt;p&gt;Create a new &lt;code&gt;index.js&lt;/code&gt; file which will be the entry point of our server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ignore-styles&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@babel/register&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)({&lt;/span&gt;
  &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;/node_modules/&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;presets&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;@babel/preset-env&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;@babel/preset-react&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="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./server&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;Now, what's all this? 🤯 Ok so let me tell you, you'll be requiring some packages so that our app works as desired.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ignore-styles&lt;/strong&gt; is required for correctly rendering our styles. If you remove this your app will be rendered but without styles and who wants that. So make sure you include this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/babel"&gt;@babel&lt;/a&gt;/register&lt;/strong&gt; is required for simply transpiling our code. For more information, you can check out my &lt;a href="https://stackoverflow.com/questions/68716822/ssr-with-react-unexpected-token-in-call-to-rendertostring" rel="noopener noreferrer"&gt;stackoverflow&lt;/a&gt; question which I asked recently. Also, don't forget to check out the comment section of the accepted answer you'll learn a lot from there &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 : Testing our app
&lt;/h3&gt;

&lt;p&gt;Now, you're all done. Let's test our app. Since our server is serving the static files we need to generate them first. Navigate to your working directory and type&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 build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a &lt;code&gt;build&lt;/code&gt; folder will be generated which contains all the static files that our server requires.&lt;/p&gt;

&lt;p&gt;Next, in your terminal type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node server/index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now check your browser at &lt;code&gt;localhost:5000&lt;/code&gt; you'll see your app rendered on the screen. Hurray! ⚡&lt;/p&gt;

&lt;p&gt;Therefore, we've achieved our goal of sending a pre-rendered HTML markup to our users.&lt;/p&gt;

&lt;p&gt;Pheww...that's a lot, now you have a Universal(or Isomorphic) app ready with you. Congrats. 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This article was a continuation to &lt;a href="https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h"&gt;Server-side rendering(SSR) with React[Part-1]&lt;/a&gt; so I would recommend you to read this quick article to know the &lt;strong&gt;WHY&lt;/strong&gt; behind all this.&lt;/p&gt;

&lt;p&gt;I hope you liked the content. More articles are on the way, Stay Tuned! 🔥&lt;br&gt;
If you have any suggestions or questions or found this article helpful, please let me know in the comments.&lt;/p&gt;

&lt;p&gt;Follow me on &lt;a href="https://twitter.com/thesavvycoder" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/68716822/ssr-with-react-unexpected-token-in-call-to-rendertostring" rel="noopener noreferrer"&gt;SSR with React : Unexpected token '&amp;lt;' in call to renderToString()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/46516395/whats-the-difference-between-hydrate-and-render-in-react-16" rel="noopener noreferrer"&gt;What's the difference between hydrate() and render() in React 16?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/server-side-rendering-your-react-app-in-three-simple-steps-7a82b95db82e/" rel="noopener noreferrer"&gt;How to implement server-side rendering in your React app in three simple steps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/server-side-rendering-your-react-app-in-three-simple-steps-7a82b95db82e/" rel="noopener noreferrer"&gt;Enabling server-side rendering in React for improved app performance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>Server-side rendering(SSR) with React[Part-1]</title>
      <dc:creator>Tarun Singh</dc:creator>
      <pubDate>Wed, 30 Jun 2021 17:44:42 +0000</pubDate>
      <link>https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h</link>
      <guid>https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-1-160h</guid>
      <description>&lt;h3&gt;
  
  
  Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Client-side-rendering&lt;/li&gt;
&lt;li&gt;Drawbacks&lt;/li&gt;
&lt;li&gt;Server-side rendering&lt;/li&gt;
&lt;li&gt;Drawbacks&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article is not for beginners, I'll assume that you save some experience working with React.&lt;br&gt;
The article consists of two parts, this is Part-1 of the article. The first part covers the fundamentals that are required to actually know how SSR  with react works. We'll then move on to Part-2 where I'll explain SSR with react and also the implementation about how can we enable SSR in React and give our app a performance boost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Article mirrors&lt;/strong&gt; &lt;br&gt;&lt;br&gt;
Read in your preferred platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tarunsingh.hashnode.dev/server-side-renderingssr-with-reactpart-1"&gt;hashnode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We know how React renders our app on the client-side. We can as well render our React app at the server-side and leverage the advantages that SSR offers us. But before going any further let's have a look at what we mean by client-side and server-side rendering.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Client-side rendering?
&lt;/h2&gt;

&lt;p&gt;When developers talk about client-side rendering they're talking about JavaScript rendering the content of our webpage in the browser.&lt;/p&gt;

&lt;p&gt;If you have some experience with building react applications, by now you would be familiar with &lt;code&gt;&amp;lt;div id=" root "&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;, that is where our application content renders. The JavaScript file is responsible for dynamically rendering the content of our website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawbacks
&lt;/h2&gt;

&lt;p&gt;When we visit a website that is client-side rendered, with the HTTP request the javascript file is downloaded, and till the time the javascript file downloads we have nothing to render on our screen, we'll be seeing a blank page.&lt;br&gt;
Now,  as soon as the download completes HTML markup is loaded, and finally, we see our app rendered.&lt;br&gt;
&lt;strong&gt;Initial load time&lt;/strong&gt; is increased if the size of the js file is heavy. That means the user needs to wait for some time before our app is loaded and we don't want our user to keep hanging till the app loads.&lt;/p&gt;

&lt;p&gt;Also, if we're concerned about &lt;strong&gt;SEO&lt;/strong&gt; we should not be rendering our app client-side.&lt;br&gt;
Web Crawlers are unable to index our site since they'll be seeing a blank page while our javascript file still loads. Therefore, client-side rendering impacts our website ranking.&lt;/p&gt;

&lt;p&gt;Is there a better way to render our app? Yes!  &lt;strong&gt;Server-side rendering to our rescue&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Server-side rendering?
&lt;/h2&gt;

&lt;p&gt;In Server-side rendering(or SSR) we load our HTML pages onto the server instead of rendering them in the browser. &lt;br&gt;
When we visit a website, we make an HTTP request to our server, the server sends back a fully rendered HTML page as a response that almost instantly gets rendered(also depends on the user's internet speed, location of the server, and on a multitude of factors).&lt;/p&gt;

&lt;p&gt;This solves our issue related to &lt;strong&gt;initial load time&lt;/strong&gt;.  Also, Web Crawler now sees a rendered page and can index our app thereby ensuring &lt;strong&gt;SEO&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;However, now let's look at another side of the SSR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawbacks
&lt;/h2&gt;

&lt;p&gt;Though it solves the problem that we faced with client-side rendering it has its downside.&lt;/p&gt;

&lt;p&gt;Suppose we visit a website that is server-side rendered. Our app loads fully rendered content returned by the server almost instantly as discussed. However, if we navigate to another page of our app, we make another request to our server returning us the corresponding webpage, and then the content is rendered from the ground up.&lt;/p&gt;

&lt;p&gt;As we see that even for a small change that needs to be rendered while we navigate to another page the content is fetched and &lt;strong&gt;rendered from the ground up&lt;/strong&gt;. That means with every request the entire new page would be rendered, and not just the new content. &lt;br&gt;
Therefore, we make &lt;strong&gt;frequent requests&lt;/strong&gt; to the server, which is bad.&lt;/p&gt;

&lt;p&gt;So, can we solve this issue of making frequent requests and avoid full page reloads? Yes!  &lt;strong&gt;SSR with React&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we saw two different ways of rendering our content i.e client-side and SSR. We also saw what are the drawbacks of both and how they solve them. &lt;br&gt;&lt;br&gt;
&lt;strong&gt;In PART-2 of this article, I'll cover SSR with React and how we can enable SSR in React.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I hope you liked the content, &lt;del&gt;Part-2 is coming soon. Stay Tuned!&lt;/del&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/tarunsingh/server-side-rendering-ssr-with-react-part-2-gin"&gt;PART-2&lt;/a&gt; is now live.&lt;/strong&gt;🔥 &lt;br&gt;&lt;br&gt;
 If you have any suggestions or questions or found this article helpful, please let me know in the comments.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Follow me on &lt;a href="https://twitter.com/thesavvycoder"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>Off I Go with Hacktoberfest  🚀 🚀 </title>
      <dc:creator>Tarun Singh</dc:creator>
      <pubDate>Wed, 21 Oct 2020 17:50:10 +0000</pubDate>
      <link>https://dev.to/tarunsingh/off-i-go-with-hacktoberfest-2o05</link>
      <guid>https://dev.to/tarunsingh/off-i-go-with-hacktoberfest-2o05</guid>
      <description>&lt;h2&gt;
  
  
  What I Learned From Hacktoberfest
&lt;/h2&gt;

&lt;p&gt;This was my first time contributing to open source. This was so much fun. I am new to development but due to this I learned a lot! I am in love with developing now. So great to see this these initiatives that make you push your limits. Wonderful experience. Onwards and upwards.🚀🚀&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
  </channel>
</rss>
