<?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 Devvrat Sharma on Medium]]></title>
        <description><![CDATA[Stories by Devvrat Sharma on Medium]]></description>
        <link>https://medium.com/@devvratsharma5891?source=rss-5512094f0c5c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i4aAzLeD99atBVSUg3ZC8A.jpeg</url>
            <title>Stories by Devvrat Sharma on Medium</title>
            <link>https://medium.com/@devvratsharma5891?source=rss-5512094f0c5c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 04:48:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devvratsharma5891/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[React 19 is Here — And It’s a Big Deal for Frontend Developers]]></title>
            <link>https://medium.com/@devvratsharma5891/react-19-is-here-and-its-a-big-deal-for-frontend-developers-2040ec6a2e84?source=rss-5512094f0c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2040ec6a2e84</guid>
            <dc:creator><![CDATA[Devvrat Sharma]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 16:54:38 GMT</pubDate>
            <atom:updated>2025-06-13T16:55:41.565Z</atom:updated>
            <content:encoded><![CDATA[<h3>Meet React 19</h3><p><strong>React 19 is Here — And It’s a Big Deal for Frontend Developers</strong></p><p>React 19 is finally out, and it’s packed with upgrades that aim to make our lives easier — and our apps faster.</p><p>I’ve been exploring the new features, so here’s a friendly breakdown of what’s new, why it matters, and how it might change the way we build web apps in 2025 and beyond.</p><p><strong>1. Actions: Forms &amp; Mutations, Simplified</strong></p><p>One of the biggest highlights is **<strong>Actions</strong>**. Think of Actions as a built-in, no-hassle way to handle form submissions and data mutations.</p><p>Instead of wiring up a separate handler, calling APIs, and fiddling with loading states yourself, you define an `action` function and pass it to your form. React handles the rest — including optimistic UI and error handling.</p><p>It’s basically taking the best ideas from frameworks like Next.js Server Actions and baking them directly into React. Less boilerplate. More sanity.</p><p><strong>2. The React Compiler: Write Less, Do More</strong></p><p>React 19 ships with an official **compiler** (it’s optional for now, but trust me — you’ll want it).</p><p>What does it do? <br>It automatically optimizes your components:<br>- It memoizes props and callbacks under the hood<br>- It prevents unnecessary re-renders<br>- It lets you write plain, clean React without sprinkling `useMemo` and `useCallback` everywhere</p><p>This means fewer performance footguns — and more time to focus on real features.</p><p><strong>3. Server Components Are Ready for Prime Time</strong></p><p>Server Components are no longer experimental — they’re a stable part of React 19.</p><p>In short, you can now render parts of your UI on the server, which keeps your bundles small and your app fast. This is a big deal for performance and SEO.</p><p>Combined with Actions, you can build full-stack UIs without needing a ton of client-side state management. The line between “frontend” and “backend” is getting blurrier — and I’m here for it.</p><p><strong>4. Better Suspense &amp; Streaming</strong></p><p>Suspense and streaming have gotten upgrades too. You’ll notice smoother loading states and better support for progressive rendering.</p><p>Frameworks can deliver parts of your page faster — improving time-to-interactive and Core Web Vitals automatically.</p><p><strong>5. Developer Experience Just Got Better</strong></p><p>The React team didn’t forget about us developers:<br> — Clearer errors <br> — Better debugging tools <br> — Consistent behavior between dev and prod <br> — Better integration with dev tools</p><p>Basically, less time yelling at your console — more time building cool stuff.</p><p><strong>6. Concurrent Features: Simpler, Smarter</strong></p><p>React 19 continues to polish its concurrent rendering features. Suspense, Transitions, and Selective Hydration are more robust and easier to adopt.</p><p>The end result? Apps that feel smooth even during heavy updates.</p><p><strong>Should You Upgrade?</strong></p><p>**<strong>Short answer</strong>:** <strong>Yes</strong> — but read your framework’s release notes first.</p><p>Actions and Server Components need bundler and framework support. If you use Next.js or Remix, you’re in luck: they’re already adding React 19 support.</p><p>In the meantime, you can try the compiler today for instant performance boosts with zero code changes.</p><p><strong>Final Thoughts</strong></p><p>React 19 shows how serious the React team is about pushing modern web apps forward. They’re making React:<br>- Faster by default<br>- Less reliant on manual optimizations<br>- More full-stack friendly</p><p>I’m excited — and cautiously optimistic — about where this is heading.</p><p><strong>Useful Links</strong></p><p>- [React 19 Release Notes](<a href="https://react.dev/blog">https://react.dev/blog</a>)<br>- [React Compiler Details](<a href="https://react.dev/">https://react.dev</a>)<br>- [Actions RFC](<a href="https://github.com/reactjs/rfcs">https://github.com/reactjs/rfcs</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2040ec6a2e84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forms : React Refs]]></title>
            <link>https://medium.com/@devvratsharma5891/forms-react-refs-5cbf08b568f2?source=rss-5512094f0c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cbf08b568f2</guid>
            <dc:creator><![CDATA[Devvrat Sharma]]></dc:creator>
            <pubDate>Fri, 02 Oct 2020 18:29:20 GMT</pubDate>
            <atom:updated>2020-10-02T18:29:20.243Z</atom:updated>
            <content:encoded><![CDATA[<h3>Forms : React Refs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QwAivsjKxhgPxZJXKjip9g.jpeg" /></figure><p>We can create two different ways of forms in React:</p><p>1. Controlled component</p><p>2. Uncontrolled component</p><blockquote><strong>Controlled component</strong></blockquote><p>In HTML, form elements such as &lt;input&gt;, &lt;textarea&gt;, and &lt;select&gt; typically maintains their own state and that gets updated based on user input. But in React, we handle it using state and state gets updated using setState() method. So an input form element whose value is controlled by React in this way will be called a controlled component.</p><p>Below is an example of a controlled component where it has a value attribute and a handler function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cd54IKIEWMMdhe3cPdFpPw.png" /></figure><blockquote><strong>Uncontrolled component</strong></blockquote><p>The traditional HTML input elements are uncontrolled component, where the form data is handled by DOM itself. In uncontrolled component, we do not use the value attributes.</p><p>Below is the example for an uncontrolled component:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*RPtIsDHwVJ6l-3yA5r-80Q.png" /></figure><p>Here, input will not have value attribute and event handler, instead to get the value from the DOM ref is used as follows:</p><p>In React, ref provides a way to access the DOM node or the React elements, and helps in getting the value from the DOM.</p><p>refs are to be used when we have the below requirements:</p><p>1. Integrating with third-party libraries, like D3 which has it’s own DOM manipulation API’s</p><p>2. To use media playbacks like audio, video. refs provide control over the DOM API.</p><p>3. Trigger imperative animations</p><p>By using refs, we are deviating from the React way of handling data. In React we store data as state and when the state in updated component gets re-rendered. This follows a unidirectional data flow and the data is stored in a single source of truth i.e., state</p><p>Let’s see how ref and refs will be used to get the reference of a node.</p><p>We need to create a ref instance within the constructor as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0Ohrz3SyXVK7fid0Prd2w.png" /></figure><p>When we assign ref attribute to the input field, the ref created in the constructor will receive the DOM element.</p><p>We can access the value of the input field as “ <strong><em>this.titleRef.current.value;”</em></strong></p><p>Refs can be used in functional component as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKxxHAstOmrZ97kR_nT5nA.png" /></figure><p>I hope you would have enjoyed this article, if it is so then please show some love by claps 👏 👏 👏 for this article….!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cbf08b568f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxJS Observables]]></title>
            <link>https://medium.com/@devvratsharma5891/rxjs-observables-6af8542c9909?source=rss-5512094f0c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6af8542c9909</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Devvrat Sharma]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 17:39:47 GMT</pubDate>
            <atom:updated>2020-09-28T17:39:47.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_rD5DdW8GSgRajKiK0hWQ.png" /></figure><blockquote>What is RxJS ?</blockquote><ul><li>RxJS is a reactive streams library used to work with asynchronous streams of data.</li><li>RxJS is a javascript library that brings the concept of “reactive programming” to the web.</li><li>Your software is built to “react” to changes that happen (like click events, data being fetched, etc) instead of the typical way of writing software where we explicitly write code (“imperative” programming) to handle those changes</li><li>Observables, in RxJS, are used to represent asynchronous streams of data. Observables are a more advanced version of Promises in JavaScript.</li></ul><blockquote>Why RxJS Observables?</blockquote><p>Angular team has recommended Observables for asynchronous calls because of the following reasons:</p><ol><li>Promises emit a single value whereas observables (streams) emit many values.</li><li>Observables can be cancellable where Promises are not cancellable. If any HTTP response is not required, observables allow us to cancel the subscription whereas promises execute either success or failure callback even if we don’t need the result</li><li>Observables support functional operators such as map, filter, reduce, etc.</li></ol><p>If you’re still confused, don’t worry, this normally doesn’t make much sense at this point. Let us see how to create and use an observable in Angular.</p><p>Example: <strong><em>app.component.ts</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjodeDu_NgKSsUvv23NeWA.png" /></figure><p><em>Line 2</em>: imports Observable class from rxjs module</p><p><em>Line 11</em>: data is of type Observable which holds numeric values</p><p><em>Line 16</em>: fetchData() is invoked on click of a button</p><p><em>Line 17</em>: A new Observable is created and stored in the variable data</p><p><em>Line 18–20</em>: next() method of Observable sends the given data through the stream. With a delay of 1,2 and 3 seconds, a stream of numeric values will be sent. Complete() method completes the Observable stream i.e., closes the stream.</p><p><em>Line 23</em>: Observable has another method called subscribe which listens to the data coming through the stream. Subscribe() method has three parameters. The first parameter is a success callback which will be invoked upon receiving successful data from the stream. The second parameter is an error callback which will be invoked when Observable returns an error and third parameter is a complete callback which will be invoked upon successful streaming of values from Observable i.e., once complete() is invoked. Here upon the successful response, the data is pushed to the local array called myArray, if any error occurs, a Boolean value called true is stored in errors variable and upon complete() will assign a Boolean value true in a finished variable</p><p><strong><em>app.component.html</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Fqf_CAgI4ckBQSN8skfXg.png" /></figure><p><em>Line 4</em>: ngFor loop is iterated on myArray which will display the values on the <em>page</em></p><p><em>Line 5</em>: {{ errors }} will render the value of errors property if any.</p><p>I hope you would have enjoyed this article, if it is so then please show some love by claps 👏 👏 👏 for this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6af8542c9909" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s Guide to React Hooks : Part 1]]></title>
            <link>https://medium.com/@devvratsharma5891/beginners-guide-to-react-hooks-part-1-a91beac42cf2?source=rss-5512094f0c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a91beac42cf2</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Devvrat Sharma]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 15:47:56 GMT</pubDate>
            <atom:updated>2020-09-27T15:47:56.764Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beginner’s Guide to React Hooks : Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ijet6kVJqGgul6adezDLQ.png" /></figure><h3>What are hooks ?</h3><p>React hooks are JavaScript functions, which allows the developer to interact with the state and lifecycle methods through functional components</p><p>Earlier we could associate state, modify the state, and implement lifecycle methods only in class components, whereas functional components were used only to present the UI content, but now with React 16.8 we can achieve the above-mentioned tasks in functional components using React hooks.</p><p>The different hooks available in React are</p><ul><li>useState()</li><li>useEffect()</li><li>useContext()</li></ul><blockquote><strong>Why useState() ?</strong></blockquote><p>useState hook is used to add or initialize state value within a functional component. It is equivalent to this.state statement of Class component which is used to initialize the state value. This hook helps to preserve the state value of a component.</p><p>Syntax — useState() can be written as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*kQ7M5s3kxvZM5KldxOuUIw.png" /></figure><p>useState() is a function which takes ‘initialState’ as the initial value for the state variable and returns 2 values.</p><p>Where, ‘state’ is a state variable which holds the initial value passed to it i.e. ‘initialState’ and ‘setState’ is a function to update the ‘state’.</p><p>Whenever we want to update the ‘state’ value then we can use the second parameter ‘setState’ which is returned from the useState() function, which is equivalent to this.setState statement of the Class component.</p><p>Let us understand useState() from the below example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*DyOkckgqccKYWUUtfNnrsQ.png" /></figure><p>In the above example <em>useState()</em> hook helps to set the initial value as “<strong>Dev</strong>”.</p><p>Line 4: ‘name’ is the state of the component ‘App’. <em>useState()</em> returns a state ‘name’ with its initial value ‘<strong>Dev</strong>’ and ‘setName’ function.</p><p>Line 8: When user clicks on the button, Change event gets fired and due to which ‘name’ state value gets updated to <strong>“Devvrat”</strong> through <em>setName </em>method execution.</p><p>We can use <em>useState</em>() hook any number of times in any component to set multiple state variables as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJ4zXdhVF68MjihoBozIlw.png" /></figure><blockquote><strong>Why useEffect() ?</strong></blockquote><p>In order to run some code after the component mounts or after the component updates, then we use <em>componentDidMount </em>and <em>componentDidUpdate </em>lifecycle methods in class based components respectively.</p><p>As we cannot use these lifecycle methods in functional components, we can use <em>useEffect()</em> hook instead.</p><p><em>useEffect()</em> method gets executed in both cases i.e. after first render and every time the component gets updated.</p><p>Syntax —<em> useEffect()</em> can be written as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*Q3ixIDb2zX9vmIiY5Hc1cg.png" /></figure><p>The useEffect() method takes an array as a second argument:</p><p>If we pass an empty array as a second argument then the useEffect method runs only after the component mounts not after the component updates. It is equivalent to componentDidMount method in class based component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*2jfakzBfOqjibgKX9v3ULA.png" /></figure><p>When we pass a specific state as second argument as shown below, then the useEffect method will run once for the initial render and then every time when the specific state passed updates and not for other state updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*U-kaKm_1LUk2SmpUCb6jZg.png" /></figure><p>We can handle asynchronous calls within the useEffect() method which is similar to how we handle asynchronous calls using componentDidMount() method in class based components.</p><p>We need to pass the second argument as an empty array to the useEffect() method, since we want the useEffect() method to be called only after the component mounts and not when the component updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVQRpGSC2ma1XJEU-CGl8w.png" /></figure><p>I will be writing for other react hooks in upcoming blogs, till then keep learning and keep coding….!!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a91beac42cf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>