<?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 Khush on Medium]]></title>
        <description><![CDATA[Stories by Khush on Medium]]></description>
        <link>https://medium.com/@khush_?source=rss-19c9d4fdcf2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Aq2YoVHVmlgEk5uAgYwsOw.jpeg</url>
            <title>Stories by Khush on Medium</title>
            <link>https://medium.com/@khush_?source=rss-19c9d4fdcf2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:39:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khush_/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[Unveiling React 19: New hooks Explained!]]></title>
            <link>https://medium.com/@khush_/unveiling-react-19-new-hooks-explained-6d41ffb2cd1a?source=rss-19c9d4fdcf2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d41ffb2cd1a</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-19]]></category>
            <dc:creator><![CDATA[Khush]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 08:37:58 GMT</pubDate>
            <atom:updated>2024-03-12T08:53:42.452Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dWqIfmr120xpZjUDTI52w.png" /></figure><p>React 19 is here, and it’s bringing some seriously cool stuff to the table. Among the highlights are four new hooks: useOptimistic, useFormStatus, useFormState, and the intriguingly named use. So, let&#39;s dive in and see how these hooks can sprinkle some magic into your coding adventures.</p><h3>Exploring React 19’s New Hooks:</h3><ol><li><a href="https://react.dev/reference/react/useOptimistic"><em>useOptimistic</em></a><em>: </em>Imagine this: you click a button, and bam! The UI updates instantly, no waiting around for the server to catch up. That’s what optimistic UI is all about, and the useOptimistic hook makes it a piece of cake to implement. It allows you to update the UI optimistically before receiving confirmation from the server, providing a seamless user experience. With useOptimistic, you can ensure that your users never have to twiddle their thumbs waiting for feedback again.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fhsvs2d%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252FApp.js&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fhsvs2d%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252FApp.js&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fhsvs2d%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/092ae4c42c903a88485b32d155dc8a4d/href">https://medium.com/media/092ae4c42c903a88485b32d155dc8a4d/href</a></iframe><p>2. <em>useFormStatus: </em>The useFormStatus hook manages the status of form fields, handling validation logic and submission state, making form management a breeze. It gives you status information of the last form submission.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F2qyqy4%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252Fapp.js&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fembed%2F2qyqy4%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252Fapp.js&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F2qyqy4%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/709769767e48630daa163654966e6574/href">https://medium.com/media/709769767e48630daa163654966e6574/href</a></iframe><p>3.<em> useFormState: </em>The useFormState hook serves as a manager for form input states, offering a centralized mechanism to monitor and modify their values efficiently. It allows you to update state based on the outcome of form actions.</p><p>This hook requires two arguments:</p><ol><li>fn: This parameter represents the function to execute when the form is submitted or a button is pressed. Upon invocation, this function receives the previous state of the form (initially the initialState that you pass, subsequently its previous return value) as its initial argument, followed by the arguments that a form action normally receives.</li><li>initialState: This argument denotes the initial state value desired for the form. It can be any serializable value. Once the action is initially invoked, this parameter becomes irrelevant.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fyv2vzy%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252FApp.js&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fyv2vzy%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252FApp.js&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fyv2vzy%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb4a70518e6ba298889bcaefcbb1cd46/href">https://medium.com/media/cb4a70518e6ba298889bcaefcbb1cd46/href</a></iframe><p>4. use is a versatile React Hook designed to fetch and utilize the value of a resource, such as a Promise or context, within your components or custom hooks. What sets use apart from other React Hooks is its unique ability to be invoked within loops and conditional statements, such as if blocks. However, it still adheres to the standard requirement that the function utilizing use must be either a Component or another Hook.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F8dg646%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252Fmessage.js&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fembed%2F8dg646%3Fview%3DEditor%2B%252B%2BPreview%26module%3D%252Fsrc%252Fmessage.js&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F8dg646%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/aeee3660144819dbac473e8f3a9655fd/href">https://medium.com/media/aeee3660144819dbac473e8f3a9655fd/href</a></iframe><p>And that’s a wrap, folks! You can read about React 19’s new hooks in depth and their potential uses from the official react documentation:<br><a href="https://react.dev/reference/react/use"><em>use</em></a><em> , </em><a href="https://react.dev/reference/react-dom/hooks/useFormState"><em>useFormState</em></a>, <a href="https://react.dev/reference/react-dom/hooks/useFormStatus"><em>useFormStatus</em></a>, <a href="https://react.dev/reference/react/useOptimistic"><em>useOptimistic</em></a></p><p>So, next time you’re coding away, keep these hooks in mind. They’ll make your life easier and your projects way more awesome. After all, in the world of web dev, it’s all about staying fresh. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d41ffb2cd1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>