<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aishwarya Parab on Medium]]></title>
        <description><![CDATA[Stories by Aishwarya Parab on Medium]]></description>
        <link>https://medium.com/@aishwaryaparab1?source=rss-7f4459f0f5a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*l-cpQcib9xin7oJX</url>
            <title>Stories by Aishwarya Parab on Medium</title>
            <link>https://medium.com/@aishwaryaparab1?source=rss-7f4459f0f5a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 15:20:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aishwaryaparab1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is Event Loop in JavaScript?]]></title>
            <link>https://medium.com/@aishwaryaparab1/what-is-event-loop-in-javascript-d1d868ce30a6?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1d868ce30a6</guid>
            <category><![CDATA[call-stack]]></category>
            <category><![CDATA[event-loop]]></category>
            <category><![CDATA[promises]]></category>
            <category><![CDATA[callback]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 12:55:22 GMT</pubDate>
            <atom:updated>2025-06-13T12:55:22.593Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Ever wondered why your </em><em>setTimeout with 0ms delay doesn’t run immediately? Or why </em><em>console.log sometimes appears in a weird order?</em></p><p>Welcome to the wonderfully weird world of the <strong>Event Loop</strong> — the heart of asynchronous JavaScript!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wW488kRiw26E288om4JiQ.png" /><figcaption>Image Credits: GeeksForGeeks</figcaption></figure><h3>JavaScript is <em>actually</em> Single-Threaded</h3><p>JavaScript executes one line at a time on a single thread. That means only <strong>one task can run at a time</strong>. But then how do we handle asynchronous things like setTimeout, network calls or Promises?</p><p>That’s where the <strong>Event Loop</strong> comes in.</p><p>Think of it as a smart traffic cop managing two lanes:</p><ul><li>🚗 <strong>Call Stack</strong> — Where functions run</li><li>🚌 <strong>Callback Queue / Task Queue</strong> — Where async callbacks wait</li></ul><p>Let’s see this in action 👇</p><h3>Basic Example: What gets logged?</h3><pre>console.log(&#39;1&#39;);<br><br>setTimeout(() =&gt; {<br>  console.log(&#39;2&#39;);<br>}, 0);<br><br>console.log(&#39;3&#39;);</pre><p>You might think this prints:</p><pre>1<br>2<br>3</pre><p>But it actually prints:</p><pre>1<br>3<br>2</pre><h4>Why?</h4><ul><li>console.log(&#39;1&#39;) → runs immediately</li><li>setTimeout gets handed off to the <strong>Web API</strong>, then to the <strong>Callback Queue</strong></li><li>console.log(&#39;3&#39;) → runs before the Event Loop pushes the timeout callback back in</li></ul><p>The Event Loop ensures that the <strong>call stack is empty</strong> before it handles any async callbacks.</p><h3>Promises vs setTimeout</h3><pre>console.log(&#39;Start&#39;);<br><br>setTimeout(() =&gt; {<br>  console.log(&#39;Timeout&#39;);<br>}, 0);<br><br>Promise.resolve().then(() =&gt; {<br>  console.log(&#39;Promise&#39;);<br>});<br><br>console.log(&#39;End&#39;);</pre><p>What gets printed?</p><pre>Start<br>End<br>Promise<br>Timeout</pre><h4>Why?</h4><p>JavaScript has:</p><ul><li><strong>Microtasks Queue</strong> — e.g., Promise.then()</li><li><strong>Macrotasks Queue</strong> — e.g., setTimeout, setInterval</li></ul><p><strong>Microtasks</strong> are given priority and executed <strong>before</strong> any macrotasks.</p><h3>What about setInterval, fetch, and requestAnimationFrame?</h3><p>These are all handled by Web APIs:</p><ul><li>setInterval: loops via the callback queue</li><li>fetch: uses Promises (microtask queue)</li><li>requestAnimationFrame: scheduled just before next repaint (not in task queues)</li></ul><h3>Real Dev Tip: Avoid Blocking the Stack</h3><p>If you run a heavy task like this:</p><pre>while (true) {<br>  // Infinite loop 😬<br>}</pre><p>You block everything, even setTimeout won’t fire. Because the <strong>call stack is never empty</strong>, the Event Loop can’t push anything in.</p><p>So always keep tasks non-blocking (use Web Workers, chunk processing, etc.)</p><p>If you made it this far, you’re already ahead of many devs ✨</p><p>Next time you debug weird setTimeout or useEffect timing issues, you’ll know exactly where to look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*oIYhul-9BVBrVm7F.gif" /></figure><p>And that’s a wrap! 🎬</p><p><strong>If you found this helpful</strong>, hit that 👏 button and follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a> for more <strong>Frontend, React and Next.js </strong>goodness. Also, drop your valuable feedback in the comments regarding this blog!</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1d868ce30a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⚡ CSR vs SSR vs SSG in Next.js — What, When and Why (with Code Examples!)]]></title>
            <link>https://medium.com/@aishwaryaparab1/csr-vs-ssr-vs-ssg-in-next-js-what-when-and-why-with-code-examples-fc55c13c2c80?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc55c13c2c80</guid>
            <category><![CDATA[static-site-generation]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[server-side-rendering]]></category>
            <category><![CDATA[client-side-rendering]]></category>
            <category><![CDATA[csr]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Thu, 05 Jun 2025 08:08:13 GMT</pubDate>
            <atom:updated>2025-06-05T08:08:13.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>⚡ CSR vs SSR vs SSG in Next.js — What, When and Why (with Code Examples!)</h3><blockquote>“Wait… how exactly is this page getting rendered?”<br>- every React dev working on a Next.js app, at some point.</blockquote><p>Next.js is amazing, but the rendering options can feel like a menu with too many choices.<br>CSR, SSR, SSG… sounds like a secret agent lineup. 🕵️‍♀️</p><p>Let’s break it down in a way that’s super simple, dev-friendly and backed with real-world code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzxtHnQFZyLyQlI2imoB4g.png" /></figure><h3>🧠 What are CSR, SSR and SSG?</h3><h4>1. Client-Side Rendering (CSR)</h4><p>In CSR, your component loads <strong>blank</strong> and then fetches data <strong>on the client (browser)</strong> using hooks like useEffect.</p><p>Code example of CSR in Next.js:</p><pre>// pages/csr-example.js<br>import { useEffect, useState } from &#39;react&#39;;<br><br>export default function CSRExample() {<br>  const [joke, setJoke] = useState(null);<br><br>  useEffect(() =&gt; {<br>    fetch(&#39;https://api.chucknorris.io/jokes/random&#39;)<br>      .then(res =&gt; res.json())<br>      .then(data =&gt; setJoke(data.value));<br>  }, []);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Client-Side Rendering&lt;/h1&gt;<br>      {joke ? &lt;p&gt;{joke}&lt;/p&gt; : &lt;p&gt;Loading...&lt;/p&gt;}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>✅ <strong>Pros:</strong></p><ul><li>Lightweight build</li><li>Great for interactive UIs</li></ul><p>❌ <strong>Cons:</strong></p><ul><li>Slower initial load (blank HTML at first)</li><li>Not SEO-friendly (since HTML has no data initially)</li></ul><p>📌 <strong>Use when:</strong></p><ul><li>The page is very dynamic and doesn’t need to be indexed by search engines.</li><li>The data is user-specific (like dashboards).</li></ul><h4>2. Server-Side Rendering (SSR)</h4><p>SSR means the page is rendered on the server <em>on every request</em>, with fresh data baked into the HTML.</p><p>Code example of SSR in Next.js:</p><pre>// pages/ssr-example.js<br>export async function getServerSideProps() {<br>  const res = await fetch(&#39;https://api.chucknorris.io/jokes/random&#39;);<br>  const data = await res.json();<br><br>  return { props: { joke: data.value } };<br>}<br><br>export default function SSRExample({ joke }) {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Server-Side Rendering&lt;/h1&gt;<br>      &lt;p&gt;{joke}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>✅ <strong>Pros:</strong></p><ul><li>SEO-friendly</li><li>Always serves fresh data</li></ul><p>❌ <strong>Cons:</strong></p><ul><li>Slower than SSG (runs on <em>every</em> request)</li><li>More server load</li></ul><p>📌 <strong>Use when:</strong></p><ul><li>You need up-to-date data (e.g., stock prices, auth-protected pages).</li><li>Content changes often and SEO matters.</li></ul><h4>3. Static Site Generation (SSG)</h4><p>SSG generates HTML <strong>at build time</strong>, which gets served instantly when a user requests the page.</p><p>Code Example of SSG in Next.js with getStaticProps</p><pre>// pages/ssg-example.js<br>export async function getStaticProps() {<br>  const res = await fetch(&#39;https://api.chucknorris.io/jokes/random&#39;);<br>  const data = await res.json();<br><br>  return {<br>    props: { joke: data.value },<br>    revalidate: 60, // Optional: ISR (Incremental Static Regeneration)<br>  };<br>}<br><br>export default function SSGExample({ joke }) {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Static Site Generation&lt;/h1&gt;<br>      &lt;p&gt;{joke}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>✅ <strong>Pros:</strong></p><ul><li>Super fast (pre-rendered)</li><li>SEO-friendly</li><li>Lower server cost</li></ul><p>❌ <strong>Cons:</strong></p><ul><li>Not great for rapidly changing data (unless using ISR)</li></ul><p>📌 <strong>Use when:</strong></p><ul><li>The content doesn’t change often</li><li>You want blazing-fast load times and good SEO (e.g., blog, landing pages)</li></ul><p>I know there’s a tiny doubt lingering in your head: What is ISR (Incremental Static Regeneration)?</p><h4>ISR (Incremental Static Regeneration)</h4><p>With revalidate, you get <strong>best of both worlds</strong> — pre-rendered pages that get updated in the background.</p><pre>return {<br>  props: { ... },<br>  revalidate: 60, // Page will be regenerated every 60 seconds<br>}</pre><p>✅ Ideal for: content that updates regularly but not in real-time.</p><h3>Here’s a Quick Recap!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9TcsXkhtSynIkaqJcwY-og.png" /><figcaption>CSR V/s SSR V/s SSG</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTTuX2S-tpe_oWjYETZu3w.png" /><figcaption>Real world scenarios</figcaption></figure><h3>📌 Interview Flashcards: CSR, SSR and SSG</h3><p><strong>Q: When would you choose SSG over SSR?</strong><br>➡️ When SEO matters and the content doesn’t change often (e.g., blog posts).</p><p><strong>Q: Is CSR bad?</strong><br>➡️ Not at all! Just not ideal for SEO-heavy pages.</p><p><strong>Q: How does </strong><strong>getServerSideProps differ from </strong><strong>getStaticProps? What happens under the hood?</strong><br>➡️ getServerSideProps: Runs <strong>on every request</strong> — server fetches the data and returns props.</p><p>getStaticProps: Runs <strong>at build time</strong> — fetches data once, pre-renders the page.</p><p>Under the hood:</p><ul><li>getServerSideProps is executed on the Node.js server.</li><li>getStaticProps runs during the build process and outputs static HTML + JSON.</li></ul><p><strong>Q: Can you explain how ISR (Incremental Static Regeneration) works in Next.js? Why is it useful?</strong></p><p>➡️ ISR lets you <strong>update static pages without rebuilding the whole site</strong>. You add a revalidate property in getStaticProps:</p><pre>export async function getStaticProps() {<br>  return {<br>    props: { ... },<br>    revalidate: 60, // Regenerate page every 60 seconds<br>  };<br>}</pre><p>Useful when you want fast load (SSG) but also fresh content (like new blog comments).</p><p><strong>Q: What are the limitations of SSG?</strong><br>➡️ Limitations:</p><ul><li>Pages are built only once at build time</li><li>Doesn’t work well for frequently changing or real-time data</li><li>Large sites may have very long build times</li></ul><p><strong>Q: Can a page in Next.js use both SSR and CSR?</strong><br>➡️ Yes. A page can be SSR-rendered with getServerSideProps and then use useEffect() on the client for further client-side interactivity.</p><p><strong>Q: What is hydration in Next.js? Why is it important in SSR/SSG?</strong><br>➡️ Hydration is the process where React attaches event listeners and makes the page interactive <strong>after</strong> the HTML is rendered.</p><p>Important because:</p><ul><li>Without hydration, the page is static and non-interactive</li><li>SSR/SSG pages are interactive only after hydration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*zQ02mNEPDriAsmZR.gif" /></figure><p>And that’s a wrap! 🎬</p><p><strong>If you found this helpful</strong>, hit that 👏 button and follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a> for more <strong>Frontend, React and Next.js </strong>goodness. Also, drop your valuable feedback in the comments regarding this blog!</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc55c13c2c80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Everything in JavaScript Has Parents: Meet Prototypal Inheritance]]></title>
            <link>https://medium.com/@aishwaryaparab1/everything-in-javascript-has-parents-meet-prototypal-inheritance-3ecb33f1d828?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ecb33f1d828</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[prototypal-inheritance]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Thu, 29 May 2025 11:26:22 GMT</pubDate>
            <atom:updated>2025-05-29T11:26:22.992Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered how JavaScript knows that arrays have .map() or that objects have .toString() even if you never defined them?</p><p>Well, you’ve just brushed up against one of the most magical concepts in JavaScript:</p><blockquote><strong>Prototypal Inheritance</strong></blockquote><p>It sounds fancy, but once you get it, it’ll be your new favourite interview flex 😎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSS5fgju2qsLXI2vI7h1-g.png" /><figcaption>Prototypal Inheritance</figcaption></figure><h3>🧠 What is Prototypal Inheritance?</h3><p>In simple terms:</p><blockquote><strong><em>Objects in JavaScript can inherit properties and methods from other objects.</em></strong></blockquote><p>And this inheritance isn’t class-based like in Java or C++. It’s <strong>prototype-based</strong>.</p><p>Each object in JavaScript has an internal link to another object called its <strong>prototype</strong> ([[Prototype]]) and it can access properties/methods from that prototype.</p><p>You can think of it like this: 🧒 You → 👨‍👦 Your parent → 👴 Grandparent<br>If you don’t know something, you ask your parent. If they don’t know, they ask your grandparent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*W24nL1ycma7z9q4I.gif" /></figure><h3>🔗 Meet __proto__ (But Don’t Use It)</h3><p>Every object has a __proto__ property that points to its prototype. For example:</p><pre>const car = {<br>  wheels: 4,<br>  drive() {<br>    console.log(&quot;Vroom vroom!&quot;);<br>  }<br>};<br><br>const myTesla = {<br>  autopilot: true<br>};<br><br>// Inherit from car<br>myTesla.__proto__ = car;<br><br>console.log(myTesla.wheels); // 4 (inherited from car)<br>myTesla.drive(); // Vroom vroom!</pre><p>🚨 <strong>Heads up:</strong> __proto__ works, but it’s old-school. Use Object.create() instead. Let’s do that next.</p><h3>✅ The Right Way: Object.create()</h3><pre>const car = {<br>  wheels: 4,<br>  drive() {<br>    console.log(&quot;Driving with &quot; + this.wheels + &quot; wheels&quot;);<br>  }<br>};<br><br>const myTesla = Object.create(car);<br>myTesla.autopilot = true;<br><br>console.log(myTesla.wheels); // 4<br>myTesla.drive(); // Driving with 4 wheels</pre><p>Here, myTesla <strong>doesn’t own</strong> the wheels or drive() method. They’re inherited via the prototype chain from car.</p><h3>🧬 How the Prototype Chain Works</h3><p>When you try to access a property or method:</p><ol><li>JS checks the object itself</li><li>If not found, it looks at its prototype</li><li>And continues up the chain until it finds it (or hits null)</li></ol><pre>console.log(myTesla.toString); // comes from Object.prototype</pre><p>So technically, every object ultimately inherits from Object.prototype unless you create it with Object.create(null).</p><h3>🧑‍🏫 Real-Life Example: Building a Shared React Utility</h3><p>Imagine you’re writing a utility for a React project. Let’s say you’re building a bunch of input validators.</p><pre>const baseValidator = {<br>  isEmpty(str) {<br>    return str.trim().length === 0;<br>  },<br>  isEmail(str) {<br>    return /\S+@\S+\.\S+/.test(str);<br>  }<br>};<br><br>const nameValidator = Object.create(baseValidator);<br>nameValidator.hasNumbers = function (str) {<br>  return /\d/.test(str);<br>};<br><br>console.log(nameValidator.isEmpty(&quot;  &quot;)); // true (from prototype)<br>console.log(nameValidator.hasNumbers(&quot;John123&quot;)); // true</pre><p>You’re now writing clean, <strong>reusable</strong>, and <strong>inheritable</strong> logic.<br>Perfect for that shared utils/ folder every React dev has.</p><h3>🔄 What about <em>class</em> in JS?</h3><p>Since ES6, you can write:</p><pre>class Animal {<br>  speak() {<br>    console.log(&quot;Animal speaks&quot;);<br>  }<br>}<br><br>class Dog extends Animal {<br>  bark() {<br>    console.log(&quot;Woof!&quot;);<br>  }<br>}<br><br>const pug = new Dog();<br>pug.bark(); // Woof!<br>pug.speak(); // Animal speaks</pre><p>👀 But behind the scenes… it’s still <strong>prototypal inheritance</strong>. The extends keyword sets up the prototype chain for you.</p><h3>📌 Interview Flashcards: Prototypal Inheritance</h3><p><strong>Q: What is prototypal inheritance?</strong><br>➡️ It’s how JavaScript objects inherit from other objects via the prototype chain.</p><p><strong>Q: How do you set up inheritance?</strong><br>➡️ Use Object.create() or class extends.</p><p><strong>Q: What is the prototype chain?</strong><br>➡️ A lookup chain where JS searches for properties/methods up through linked prototypes.</p><p><strong>Q: What’s the difference between </strong><strong>__proto__ and </strong><strong>prototype?</strong><br>➡️ __proto__ is the actual reference to the parent object; prototype is a property on constructor functions used for inheritance.</p><p><strong>Q: Why should we prefer </strong><strong>Object.create() over </strong><strong>__proto__?</strong><br>➡️ It’s more reliable and standards-compliant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*FqE5vuhYUl0tpxHh.gif" /></figure><p>And that’s a wrap! 🎬</p><p><strong>If you found this helpful</strong>, hit that 👏 button and follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a> for more <strong>Frontend</strong> and <strong>React</strong> goodness. Also, drop your valuable feedback in the comments regarding this blog!</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ecb33f1d828" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Does React Handle useState Updates Internally?]]></title>
            <link>https://medium.com/@aishwaryaparab1/how-does-react-handle-usestate-updates-internally-8091a6cb1a75?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8091a6cb1a75</guid>
            <category><![CDATA[usestate]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[react-state]]></category>
            <category><![CDATA[batch-update]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Wed, 21 May 2025 11:08:53 GMT</pubDate>
            <atom:updated>2025-05-21T11:08:53.435Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered what <em>really</em> happens under the hood when you call setState in React?</p><p>📍Why is it <strong>asynchronous</strong>?<br>📍Why doesn’t it update immediately?<br>📍And what’s up with this mysterious <strong>batching</strong> thing?</p><p>If you’ve got these questions, or you’re prepping for a frontend interview, let’s buckle up and dig deep into React’s CORE.</p><figure><img alt="Understand React State Updates" src="https://cdn-images-1.medium.com/max/1024/1*zmUikqDxa7vCqrc-XmkTDw.png" /><figcaption>Understand React State Updates</figcaption></figure><h3>⚛️ First : What is <em>useState</em> Actually Doing?</h3><p>When you write:</p><pre>const [count, setCount] = useState(0);</pre><p>React is basically doing this behind the scenes:</p><ol><li><strong>Allocating internal memory</strong> to store your count value.</li><li>Giving you a <strong>getter</strong> (count) and a <strong>setter</strong> (setCount).</li><li>When you call setCount(newValue), React:</li></ol><ul><li>Schedules an update for the component</li><li>Marks it as “dirty” and ready for re-render</li><li>Triggers the re-render at the right time in the <strong>render cycle</strong></li></ul><p>So you’re not just “setting a value”, you’re <strong><em>scheduling</em></strong> a UI update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*E7LWgZ_gk8nJ37gS.gif" /></figure><h3>🤔 Why is setState Asynchronous?</h3><p>Because React <strong>batches updates for performance</strong>.</p><p>If every call to setState caused an immediate re-render, your app would:</p><ul><li>Lag</li><li>Crash</li><li>Make your laptop sound like it’s taking off 🚀</li></ul><p>Instead, React waits for the event loop to finish (or the current lifecycle phase to end), <strong>then processes all updates together</strong>.</p><pre>function Counter() {<br>  const [count, setCount] = useState(0);<br><br>  const handleClick = () =&gt; {<br>    setCount(count + 1);<br>    setCount(count + 1);<br>    setCount(count + 1);<br>    console.log(&quot;Clicked! Count is:&quot;, count);<br>  };<br><br>  return &lt;button onClick={handleClick}&gt;Click me&lt;/button&gt;;<br>}</pre><p>You might expect the count to go up by 3… but surprise! 🎉</p><p>It only increases by <strong>1</strong>.</p><p><em>Why?</em><br>Because React <strong>batches the updates</strong> and uses the <strong>initial </strong><strong>count value (0)</strong> each time.</p><h3>🧪 How to Fix This? Use the Functional Form!</h3><p>React lets you update state using a function, which always gets the <strong>latest value</strong>:</p><pre>setCount(prev =&gt; prev + 1);<br>setCount(prev =&gt; prev + 1);<br>setCount(prev =&gt; prev + 1); // Now count goes up by 3 ✅</pre><h4>📌 Interview Nugget:</h4><blockquote><strong><em>Q: Why would you use the functional form of </em></strong><strong><em>setState?</em></strong><em><br></em><strong><em>A:</em></strong><em> To ensure you’re updating based on the </em>latest state<em>, especially when state updates are batched or depend on previous values.</em></blockquote><h3>🎯 What Is Batching in React?</h3><p><strong>Batching</strong> = Grouping multiple state updates into a single render for performance.</p><p>Before React 18, batching only happened inside React event handlers.<br>But now with <strong>automatic batching</strong> (React 18+), it works across:</p><ul><li>Timeouts</li><li>Promises</li><li>Native events</li><li>and more!</li></ul><pre>import { useState, useEffect } from &#39;react&#39;;<br><br>function AutoBatchingDemo() {<br>  const [a, setA] = useState(0);<br>  const [b, setB] = useState(0);<br><br>  useEffect(() =&gt; {<br>    setTimeout(() =&gt; {<br>      setA(1);<br>      setB(1);<br>      // Only ONE re-render will happen here in React 18+<br>    }, 1000);<br>  }, []);<br><br>  return (<br>    &lt;div&gt;<br>      A: {a}, B: {b}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>No more triggering multiple renders just because you updated two states back-to-back. 🙌</p><h3>🧵 Behind the Scenes: What Happens When You Call setState?</h3><p>Here’s a simplified view of React’s process:</p><ol><li>setState is called → state update is added to a queue</li><li>React schedules a render (if one isn’t already in progress)</li><li>During the render phase:</li></ol><ul><li>React processes the state queue</li><li>Computes the next state</li></ul><p>4. In the <strong>commit phase</strong>, React applies the changes to the DOM</p><p>That’s why console.log immediately after setState won’t give you the updated value <em>since the render hasn’t happened yet</em>.</p><h3>🕵️ Interview Questions This Topic Often Leads To</h3><p><strong>Q: Why is </strong><strong>useState asynchronous?</strong><br> ➡️ React batches updates for performance. The update is scheduled, not applied immediately.</p><p><strong>Q: How can you access the updated value of state immediately after calling </strong><strong>setState?</strong><br> ➡️ You can’t. Instead, use useEffect or the functional form.</p><p><strong>Q: What is batching? How does it work in React 18?</strong><br> ➡️ Batching groups multiple updates into one render. React 18 extends it beyond just React events.</p><p><strong>Q: What happens when you call multiple </strong><strong>setState calls with the same state variable?</strong><br> ➡️ If not using the functional form, only the last one might take effect (depending on timing and closure values).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*9zXRgf3dLVjBW5BR.gif" /></figure><p>And that’s a wrap! 🎬</p><p><strong>If you found this helpful</strong>, hit that 👏 button and follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a> for more <strong>Frontend</strong> and <strong>React</strong> goodness. Also, drop your weirdest state bug in the comments!</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8091a6cb1a75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Controlled vs Uncontrolled Components in React Forms: What’s the Deal?]]></title>
            <link>https://medium.com/@aishwaryaparab1/controlled-vs-uncontrolled-components-in-react-forms-whats-the-deal-888e9b4e1ff2?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/888e9b4e1ff2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[controlled-component]]></category>
            <category><![CDATA[uncontrolled-component]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Sat, 17 May 2025 05:52:28 GMT</pubDate>
            <atom:updated>2025-05-21T10:37:27.994Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever felt confused between <strong>controlled</strong> and <strong>uncontrolled</strong> form components in React?</p><p>You’re not alone.</p><p>Let’s break it down with real examples, silly metaphors, and clear use cases, so you can finally say:</p><blockquote><em>“I totally get this!”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dpxJK7g_pOcgA1weEZbFdQ.png" /></figure><h3>🧠 First, What’s the Difference?</h3><p>Think of a <strong>controlled component</strong> like a helicopter you fly with a remote. You control everything from outside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*XHjCYZ3yCWIHSz5l.gif" /></figure><p>An <strong>uncontrolled component</strong> is more like a self-driving car — it manages itself and you <em>check in</em> when you need info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*rPNnC0f8F9qY2ICZ.gif" /></figure><h3>🔧 Controlled Component</h3><p>In a controlled component, <strong>React is the single source of truth</strong>.</p><ul><li>Form data lives in React state</li><li>Input updates via onChange events</li><li>You <em>always</em> know the current value</li></ul><p><strong>Code Example:</strong></p><pre>import { useState } from &#39;react&#39;;<br><br>function ControlledForm() {<br>  const [name, setName] = useState(&#39;&#39;);<br><br>  const handleSubmit = (e) =&gt; {<br>    e.preventDefault();<br>    alert(`Submitted: ${name}`);<br>  };<br><br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;label&gt;<br>        Name:<br>        &lt;input <br>          type=&quot;text&quot; <br>          value={name} <br>          onChange={(e) =&gt; setName(e.target.value)} <br>        /&gt;<br>      &lt;/label&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/form&gt;<br>  );<br>}</pre><h3>🤖 Uncontrolled Component</h3><p>In an uncontrolled component, <strong>the DOM holds the form data</strong>.</p><ul><li>You access values using refs</li><li>React doesn’t track input state in real-time</li><li>Perfect when you don’t need constant updates</li></ul><p><strong>Code Example:</strong></p><pre>import { useRef } from &#39;react&#39;;<br><br>function UncontrolledForm() {<br>  const nameRef = useRef();<br><br>  const handleSubmit = (e) =&gt; {<br>    e.preventDefault();<br>    alert(`Submitted: ${nameRef.current.value}`);<br>  };<br><br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;label&gt;<br>        Name:<br>        &lt;input type=&quot;text&quot; ref={nameRef} /&gt;<br>      &lt;/label&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/form&gt;<br>  );<br>}</pre><h3>🧐 When Should You Use Each?</h3><h4>✅ Use Controlled Components When:</h4><ul><li>You need <strong>real-time validation</strong> (e.g., password strength)</li><li>Your UI <strong>changes based on input</strong> (like conditional rendering)</li><li>You want <strong>total control</strong> over the data</li><li>You’re integrating with tools like Formik, React Hook Form, etc.</li></ul><p><strong>Example:</strong><br>Live preview as you type, disabling buttons, showing errors instantly.</p><h4>💤 Use Uncontrolled Components When:</h4><ul><li>You just want to <strong>read the value once</strong> (e.g., on submit)</li><li>It’s a <strong>quick form</strong> with no fancy validation</li><li>You’re <strong>porting a legacy HTML form</strong> into React</li></ul><p><strong>Example:</strong><br>Simple newsletter sign-up form, file upload input, or one-off settings page.</p><h3>⚠️ Bonus Tip: Mix ’n’ Match Smartly</h3><p>Yes, you can <strong>mix controlled and uncontrolled</strong> components if needed.</p><p>But keep it clean as switching between them for the same field can lead to this error:</p><blockquote><em>“A component is changing an uncontrolled input to be controlled…”</em></blockquote><p>😵‍💫 Avoid that mess by picking one strategy per field.</p><h3>🚀 Final Thoughts</h3><p>Controlled components give you power.<br>Uncontrolled components give you simplicity.</p><p>Choose what fits your use case, <strong>not what sounds fancier</strong>.<br>React gives you both tools for a reason. 🛠</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*vIxHvN-wuK5pL9rM.gif" /></figure><p>And that’s a wrap! 🎬</p><p>If you found this helpful, follow <a href="https://medium.com/u/7f4459f0f5a1?source=post_page---user_mention--c8a32f23e967---------------------------------------">Aishwarya Parab</a> for more <strong>Frontend</strong> and <strong>React</strong> goodness.</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=888e9b4e1ff2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 3 React Design Patterns Every Developer Should Know ]]></title>
            <link>https://medium.com/@aishwaryaparab1/top-3-react-design-patterns-every-developer-should-know-c8a32f23e967?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8a32f23e967</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Wed, 07 May 2025 11:19:38 GMT</pubDate>
            <atom:updated>2025-05-07T11:19:38.998Z</atom:updated>
            <content:encoded><![CDATA[<p>React is fun, flexible and wildly powerful.<br>But without the right structure, even the cleanest code can become a spaghetti nightmare 🍝</p><p>Whether you’re building a hobby project or scaling a production app, <strong>design patterns</strong> can make your React code</p><p>✅ Modular<br>✅ Reusable<br>✅ Maintainable</p><p>Let’s dive into the <strong>Top 3 React Design Patterns</strong> every frontend dev should know!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lyUGCI4fen5OcyrbTEAaA.png" /><figcaption>Design Patterns for React Developers</figcaption></figure><h3>1. Container and Presentational Components</h3><p>This classic pattern <strong>separates logic from UI</strong>.</p><ul><li><strong>Container Components</strong> handle data fetching, business logic and state</li><li><strong>Presentational Components</strong> focus only on displaying props</li></ul><p>✅ Why use it?</p><ul><li>Makes components reusable and testable</li><li>Keeps UI and logic concerns cleanly separated</li></ul><pre>// UserContainer.js<br>import React, { useEffect, useState } from &#39;react&#39;;<br>import UserList from &#39;./UserList&#39;;<br><br>function UserContainer() {<br>  const [users, setUsers] = useState([]);<br><br>  useEffect(() =&gt; {<br>    fetch(&#39;https://jsonplaceholder.typicode.com/users&#39;)<br>      .then(res =&gt; res.json())<br>      .then(setUsers);<br>  }, []);<br><br>  return &lt;UserList users={users} /&gt;;<br>}<br><br>export default UserContainer;</pre><pre>// UserList.js<br>function UserList({ users }) {<br>  return (<br>    &lt;ul&gt;<br>      {users.map(user =&gt; (<br>        &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}<br><br>export default UserList;</pre><p>Notice how <em>UserList</em> takes care of rendering the users alone while the entire business logic stays in the container component.</p><p>Let’s move on to the next one!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*gZTbgk-jGx7zpEWG.gif" /></figure><h3>2. Higher-Order Components (HOCs)</h3><p>A <strong>Higher-Order Component</strong> is a function that takes a component and returns a new enhanced component.</p><pre>const withMagic = (Component) =&gt; {<br>  return function Enhanced(props) {<br>    const magic = &quot;✨ Abracadabra!&quot;;<br>    return &lt;Component {...props} magic={magic} /&gt;;<br>  };<br>};</pre><p>✅ Why use it?</p><ul><li>Great for <strong>reusing logic</strong> like authentication, theming, permissions, etc.</li><li>Keeps concerns <strong>decoupled</strong></li></ul><p>Here’s an example of authentication:</p><pre>function withAuth(Component) {<br>  return function AuthenticatedComponent(props) {<br>    const isLoggedIn = localStorage.getItem(&quot;token&quot;);<br><br>    if (!isLoggedIn) {<br>      return &lt;p&gt;Please log in to continue.&lt;/p&gt;;<br>    }<br><br>    return &lt;Component {...props} /&gt;;<br>  };<br>}</pre><pre>function Dashboard() {<br>  return &lt;h2&gt;Welcome to the dashboard!&lt;/h2&gt;;<br>}<br><br>export default withAuth(Dashboard);</pre><h3>3. Custom Hooks</h3><p>With the introduction of Hooks, we now extract logic into <strong>reusable functions</strong>.</p><p>Instead of using class lifecycle methods or HOCs, custom hooks keep things <strong>cleaner</strong> and <strong>function-based</strong>.</p><p>✅ Why use them?</p><ul><li>DRY (Don’t Repeat Yourself)</li><li>Cleaner than HOCs in many cases</li><li>Easy to share logic between components</li></ul><p>Here’s an example of a custom useFetch hook used for data fetching:</p><pre>import { useEffect, useState } from &quot;react&quot;;<br><br>function useFetch(url) {<br>  const [data, setData] = useState(null);<br><br>  useEffect(() =&gt; {<br>    let isMounted = true;<br><br>    fetch(url)<br>      .then(res =&gt; res.json())<br>      .then(json =&gt; {<br>        if (isMounted) setData(json);<br>      });<br><br>    return () =&gt; {<br>      isMounted = false;<br>    };<br>  }, [url]);<br><br>  return data;<br>}</pre><p>Yes, I can hear you, it’s just like any other function.</p><p>And yup, it’s that simple and is a legit design pattern we follow in the codebase to share repeated logic between components.</p><p>The useFetch hook can be used this way:</p><pre>function ProductList() {<br>  const products = useFetch(&#39;https://fakestoreapi.com/products&#39;);<br><br>  if (!products) return &lt;p&gt;Loading...&lt;/p&gt;;<br><br>  return (<br>    &lt;ul&gt;<br>      {products.map(p =&gt; (<br>        &lt;li key={p.id}&gt;{p.title}&lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*5bOlGhWL6kyqTYYH.gif" /></figure><p>And that’s a wrap! 🎬</p><p>If you found this helpful, follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a> for more <strong>Frontend</strong> and <strong>React</strong> goodness. Also, drop your favourite design pattern in the comments!</p><p>Would love to have a chat with you on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8a32f23e967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Abort Mission: JavaScript’s AbortController to the Rescue!]]></title>
            <link>https://medium.com/@aishwaryaparab1/abort-mission-javascripts-abortcontroller-to-the-rescue-efbdc9e88806?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/efbdc9e88806</guid>
            <category><![CDATA[abortcontroller]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[fetch-requests]]></category>
            <category><![CDATA[cancel-request]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Thu, 01 May 2025 11:22:46 GMT</pubDate>
            <atom:updated>2025-05-01T11:25:36.525Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever made a fetch request that just… hung there forever? Or tried updating state after a user navigated away and got hit with:</p><p><em>“Can’t perform a React state update on an unmounted component”</em></p><p>Yeah, we’ve all been there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUL37iuM4Vv0jNDZxeZkcw.png" /><figcaption>JavaScript’s AbortController</figcaption></figure><p>So, let me introduce you to your new async bestie: <strong>AbortController!</strong></p><h4>What is AbortController?</h4><p>AbortController is a built-in JavaScript API that lets you <strong>cancel</strong> (aka <em>abort</em>) asynchronous tasks like fetch requests.</p><p>Here’s an example of cancelling fetch requests using AbortController:</p><pre>const controller = new AbortController();<br>const signal = controller.signal;<br><br>fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;, { signal })<br>  .then(response =&gt; response.json())<br>  .then(data =&gt; console.log(data))<br>  .catch(err =&gt; {<br>    if (err.name === &#39;AbortError&#39;) {<br>      console.log(&#39;Fetch aborted!&#39;);<br>    } else {<br>      console.error(&#39;Something went wrong:&#39;, err);<br>    }<br>  });<br><br>// Cancel the fetch after 2 seconds<br>setTimeout(() =&gt; controller.abort(), 2000);</pre><ul><li>You create an instance of AbortController.</li><li>Pass the signal along with the fetch request.</li><li>Execute the abort() method of the controller when you wish to cancel the request.</li></ul><p>That’s it!</p><p>But where is this <em>actually</em> useful? I hear you!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*tkkzZrzuNm-k_P5P.gif" /></figure><h3>Use of AbortController</h3><p><strong>Searching with Autosuggestions:</strong></p><p>While building a search input, you’d know that every keystroke is essentially a new request because you’re fetching suggestions based on the search query.</p><p>While you can improve the performance of the search input by implementing debouncing, there will still be multiple requests for a single search query.</p><p>But all you need is the latest response after you’re done typing. You surely don’t want to see results for “java” after typing “javascript”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*VYeyWAuooUgdO_Hw.gif" /></figure><p>Basically, you don’t need the previous, old responses. And here’s where AbortController pops in.</p><pre>let controller;<br><br>const search = (query) =&gt; {<br>  if (controller) controller.abort(); // abort previous request<br>  controller = new AbortController();<br><br>  fetch(`/api/search?q=${query}`, { signal: controller.signal })<br>    .then(res =&gt; res.json())<br>    .then(data =&gt; console.log(data))<br>    .catch(err =&gt; {<br>      if (err.name === &#39;AbortError&#39;) {<br>        console.log(&#39;Previous search aborted.&#39;);<br>      } else {<br>        console.error(err);<br>      }<br>    });<br>};</pre><p>Every new request <em>aborts</em> the previous request.</p><p><strong>Bonus Tip:</strong> If you’re using React and creating the controller inside useEffect, don’t forget to abort the controller in the cleanup function.</p><p>Like this:</p><pre>useEffect(() =&gt; {<br>  const controller = new AbortController();<br><br>  fetch(&#39;/api/data&#39;, { signal: controller.signal })<br>    .then(res =&gt; res.json())<br>    .then(setData)<br>    .catch(console.error);<br><br>  return () =&gt; controller.abort(); // Cleanup on unmount<br>}, []);</pre><p>Hope this was helpful and for more such insightful content, follow <a href="https://medium.com/u/7f4459f0f5a1">Aishwarya Parab</a>. 💙</p><p>We can also have a quick chat on <a href="https://www.linkedin.com/in/aishwaryaparab/">LinkedIn</a>. ☕️</p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efbdc9e88806" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Best VS Code Dark Themes]]></title>
            <link>https://medium.com/@aishwaryaparab1/5-best-vs-code-dark-themes-2f3110e2bda7?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f3110e2bda7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[themes]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[vscode-extension]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 11:28:48 GMT</pubDate>
            <atom:updated>2023-07-19T18:50:12.796Z</atom:updated>
            <content:encoded><![CDATA[<p>Enhance your Coding Experience with these 5 Best VS Code Dark Themes! 🧑🏻‍💻👩🏻‍💻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dXqyb7ie_IkTUDUso8EtA.png" /><figcaption>Best VS Code Themes</figcaption></figure><p>Are you tired of staring at the same old VS Code theme day in and day out?</p><p>If you’re seeking a more pleasant coding experience, I’ve got you covered! I’m sharing my top five favourite VS Code Dark Themes that will undoubtedly add a touch of excitement to your coding journey. 🚀</p><p>Let’s get started…</p><h3>🌌 Dracula Official</h3><p>Dracula Official is an absolute classic among dark themes. With its stylish and sleek design, this theme boasts a delightful mix of purple and black hues that ensure optimal contrast and readability. The eye-catching colours will keep you focused and energised during those long coding sessions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YExY4y9dZvm_ZNH4QiRCgg.png" /><figcaption>Dracula Official</figcaption></figure><h3>🌆 Night Owl</h3><p>Night Owl is perfect for night owls like us who love to code late into the night. This theme’s soft, dark blue background and vibrant, warm syntax colors create an immersive coding environment. Plus, it includes support for a wide range of languages and extensions, making it versatile and accommodating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wepU6oOL8PaJye9qHNayOQ.png" /><figcaption>Night Owl</figcaption></figure><h3>🌃 One Dark Pro</h3><p>If you prefer a more minimalist yet modern look, One Dark Pro is the way to go. Its clean design and balanced colour palette make it a favourite among many developers. The subdued shades and thoughtful syntax highlighting ensure a soothing coding experience without compromising on aesthetics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9NbRsv2Jh5ARUq3kM8VeSw.png" /><figcaption>One Dark Pro</figcaption></figure><h3>🌠 Monokai Pro</h3><p>Monokai Pro is a fantastic dark theme that takes the classic Monokai and elevates it to new heights. With its refreshing colour scheme and eye-pleasing gradients, Monokai Pro breathes life into your code and makes it a pleasure to read and write. Trust me, you won’t be able to look away!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lsAunMDOCcE24Zc4mF_b_g.png" /><figcaption>Monokai Pro</figcaption></figure><h3>🎆 Nord</h3><p>Inspired by the stunning arctic landscapes, Nord is a delightful theme with a unique blend of cold and warm colours. Its distinct shades of blue and purple, combined with vivid accents, give your code a fresh, invigorating appearance. Experience the beauty of the North right in your VS Code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bm21OlTtZmASUOJeyeaJ0g.png" /><figcaption>Nord</figcaption></figure><p>Ready to try out these incredible themes? Here’s how you can install them in just a few clicks:</p><ol><li>Launch Visual Studio Code</li><li>Open the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window</li><li>Search for the theme by name</li><li>Click Install to apply your favorite theme</li><li>Go to Code &gt; Preferences &gt; Color Theme, and select your preferred theme</li></ol><p>And done!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FnBaHkYEzY7N0SlQSAa%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FnBaHkYEzY7N0SlQSAa%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FnBaHkYEzY7N0SlQSAa%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="241" frameborder="0" scrolling="no"><a href="https://medium.com/media/182777095f0c773d8122f5958c05571a/href">https://medium.com/media/182777095f0c773d8122f5958c05571a/href</a></iframe><p>Boost your productivity and give your coding environment a makeover with these fantastic dark themes. I hope you enjoy them as much as I do. Happy coding! 👨‍💻👩‍💻</p><p>If we haven’t connected yet, connect with me on LinkedIn — <a href="https://www.linkedin.com/in/aishwaryaparab">Aishwarya Parab</a></p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f3110e2bda7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between Library and Framework]]></title>
            <link>https://medium.com/@aishwaryaparab1/difference-between-library-and-framework-64aa8009559c?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/64aa8009559c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frameworks-and-libraries]]></category>
            <category><![CDATA[framework-vs-library]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 15:11:46 GMT</pubDate>
            <atom:updated>2023-07-17T15:11:46.493Z</atom:updated>
            <content:encoded><![CDATA[<p>Is React a library or framework? Let’s find out!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMZkpg_EiPW544d6mOVMSQ.png" /><figcaption>ReactJS — Library OR Framework</figcaption></figure><p>In the world of software development, the terms <strong>“library”</strong> and <strong>“framework”</strong> are often used interchangeably, leading to confusion for many developers. While they share similarities, there are fundamental differences between the two concepts.</p><p>Let’s dig into this and clarify the distinctions between libraries and frameworks.</p><h3>What is a Library?</h3><p>A library is a collection of <strong>pre-written code</strong> that developers can use to perform specific tasks or access functionality. Libraries typically provide reusable functions, classes, or modules that can be imported into a project to solve particular problems or enhance existing functionality.</p><p>They provide a set of <strong>tools</strong> or <strong>utilities</strong> that developers can leverage in their applications.</p><p><strong>Advantages:</strong></p><ul><li>They offer a high degree of flexibility and freedom to developers.</li><li>They do not impose any strict structure or dictate how an application should be built.</li><li>Developers have the liberty to choose which components of the library they want to use, depending on their specific needs.</li><li>Libraries are generally smaller in size compared to frameworks and can be selectively integrated into an application.</li></ul><h3>What is a Framework?</h3><p>A framework, on the other hand, is a comprehensive software platform that provides a structure and set of rules for developing applications. It offers a collection of libraries, tools, and utilities that work together to facilitate the development process.</p><p>They typically include predefined components, such as databases, user authentication systems, templating engines, and more.</p><p><strong>Advantages:</strong></p><ul><li>They simplify and speed up the development process.</li><li>Frameworks dictate the overall architecture of an application, define the flow of control, and often impose a specific coding style or design pattern.</li></ul><p>Theory without examples is nearly volatile, isn’t it? Let’s use the analogy of building a house to explain the difference between libraries and frameworks.</p><p><strong>Libraries</strong> can be compared to individual tools or resources that you use to complete specific tasks, such as, Plumbing library, Electrical library or Flooring library.</p><p><strong>Frameworks</strong>, on the other hand, can be compared to the overall blueprint or structure that guides the construction of the entire house. They provide a set of rules, conventions, and predefined components to build the house, such as, Construction, Design and Testing frameworks!</p><p>So, what would be your answer to our first question? Is React a library or framework?</p><p>React is a library because it primarily focuses on the view layer of an application, providing a set of reusable UI components and a virtual DOM for efficiently updating and rendering the user interface.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FKU60D6Of7xb4qmFQwT%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FKU60D6Of7xb4qmFQwT%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FKU60D6Of7xb4qmFQwT%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/cef1f3edc9222d93555059bbf42c3e37/href">https://medium.com/media/cef1f3edc9222d93555059bbf42c3e37/href</a></iframe><p>Hope you’ve got an answer to make informed decisions when building applications. And of course, hope you found this helpful.</p><p>If we haven’t connected yet, connect with me on LinkedIn — <a href="https://www.linkedin.com/in/aishwaryaparab">Aishwarya Parab</a></p><p>Until next time! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64aa8009559c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Vite Deploying Vite App to GitHub Pages]]></title>
            <link>https://medium.com/@aishwaryaparab1/deploying-vite-deploying-vite-app-to-github-pages-166fff40ffd3?source=rss-7f4459f0f5a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/166fff40ffd3</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Aishwarya Parab]]></dc:creator>
            <pubDate>Wed, 12 Jul 2023 16:09:00 GMT</pubDate>
            <atom:updated>2023-07-12T16:12:59.436Z</atom:updated>
            <content:encoded><![CDATA[<p>Looking for a free hosting platform to deploy your Vite app? Look no further than GitHub Pages!</p><p>Stay tuned to know how to deploy your Vite app to GitHub Pages in just <strong>5 simple steps</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eI_sTVbZVHNsS1_JULHgFQ.png" /></figure><h3>Step 1: Initialize Git Repository</h3><p>Run the following commands to initialize a git repository in your Vite app and push your existing code to a remote repository on GitHub.</p><pre>$ git init<br>$ git add .<br>$ git commit -m &quot;initial-commit&quot;<br>$ git branch -M main<br>$ git remote add origin http://github.com/{username}/{repo-name}.git<br>$ git push -u origin main</pre><h3>Step 2: Update vite.config.js</h3><p>Add the base URL in this file by setting the <strong>base</strong> as <strong>“/{repo-name}/”</strong>. For example, if your repository’s name is <strong>book-landing-page</strong> then set the <strong>base </strong>like this:</p><pre>import { defineConfig } from &#39;vite&#39;<br>import react from &#39;@vitejs/plugin-react&#39;<br><br>// https://vitejs.dev/config/<br>export default defineConfig({<br>  plugins: [react()],<br>  base: &quot;/book-landing-page/&quot;<br>})</pre><h3>Step 3: Install gh-pages</h3><p>Install <strong>gh-pages</strong> package as a dev dependency.</p><pre>npm install gh-pages --save-dev</pre><h3>Step 4: Update package.json</h3><p>Update package.json with the following <strong>predeploy</strong> and <strong>deploy</strong> scripts.</p><pre>&quot;scripts&quot;: {<br>    &quot;predeploy&quot; : &quot;npm run build&quot;,<br>    &quot;deploy&quot; : &quot;gh-pages -d dist&quot;,<br>    ...<br>}</pre><p>Add the complete website URL by setting <strong>homepage</strong> in package.json</p><pre>&quot;homepage&quot;: &quot;https://{username}.github.io/{repo-name}/&quot;</pre><p>Thus, your updated package.json will look like this:</p><pre>{<br>  &quot;name&quot;: &quot;book-product&quot;,<br>  &quot;private&quot;: true,<br>  &quot;version&quot;: &quot;0.0.0&quot;,<br>  &quot;homepage&quot;: &quot;https://aishwaryaparab.github.io/book-landing-page/&quot;,<br>  &quot;type&quot;: &quot;module&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;predeploy&quot; : &quot;npm run build&quot;,<br>    &quot;deploy&quot; : &quot;gh-pages -d dist&quot;,<br>    &quot;dev&quot;: &quot;vite&quot;,<br>    &quot;build&quot;: &quot;vite build&quot;,<br>    ...<br>}</pre><h3>Step 5: Run Deploy</h3><p>If you’ve made it till here, you’re almost there. Run the final command:</p><pre>npm run deploy</pre><p>And you’re done!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F10bHcDcPM925ry%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F10bHcDcPM925ry%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F10bHcDcPM925ry%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="208" frameborder="0" scrolling="no"><a href="https://medium.com/media/222ad0f0baa469fc3a573d0b6d361cc2/href">https://medium.com/media/222ad0f0baa469fc3a573d0b6d361cc2/href</a></iframe><p>One last step though!</p><p>Navigate to your remote repository on GitHub -&gt; Settings -&gt; Pages (left sidebar). Select source as “Deploy from branch” and branch as “gh-pages”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ybobpluBHeEmanhK7DmdNw.png" /><figcaption>GitHub Pages Settings</figcaption></figure><p>GitHub Pages also allows you to set up your own custom domain. 🙌</p><p>Have some patience, wait for a few minutes and soon, your site will be live at <a href="https://{username}.github.io/%7Brepo-name%7D/">https://{username}.github.io/{repo-name}/</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F8blb81XsdafLy%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F8blb81XsdafLy%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F8blb81XsdafLy%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="212" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cd92f4e57885f57e11eea790f71ceab/href">https://medium.com/media/1cd92f4e57885f57e11eea790f71ceab/href</a></iframe><p>Congratulations!! Your site is ready to be viewed on the Internet. All your development efforts did pay off. 🤩</p><p>Hope you found this helpful. Until next time! 👋</p><p>Happy Learning! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=166fff40ffd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>