<?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: Shruti Kapoor</title>
    <description>The latest articles on DEV Community by Shruti Kapoor (@shrutikapoor08).</description>
    <link>https://dev.to/shrutikapoor08</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%2F197069%2F406b42c3-4552-4a6f-8ce9-39a58e542a5a.jpg</url>
      <title>DEV Community: Shruti Kapoor</title>
      <link>https://dev.to/shrutikapoor08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shrutikapoor08"/>
    <language>en</language>
    <item>
      <title>Top 5 in Frontend and AI this week - AI Is Making Us Dumber + useEffect gets banned</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 20 Mar 2026 22:28:37 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/top-5-in-frontend-and-ai-this-week-ai-is-making-us-dumber-useeffect-gets-banned-9ca</link>
      <guid>https://dev.to/shrutikapoor08/top-5-in-frontend-and-ai-this-week-ai-is-making-us-dumber-useeffect-gets-banned-9ca</guid>
      <description>&lt;p&gt;This week's top 5 posts in Frontend and AI that you need to know - &lt;/p&gt;

&lt;p&gt;1️⃣ What's happening in Modern CSS? by Daniel Schwarz. CSS now has randomness, anchor positioning, and clip-path tricks that replace entire JavaScript libraries.&lt;/p&gt;

&lt;p&gt;2️⃣ NEW TanStack Hotkeys Library by Web Dev Simplified - Add keyboard shortcuts with zero boilerplate, cross-platform modifier keys, and smart scoping built in.&lt;/p&gt;

&lt;p&gt;3️⃣ The Hidden Cost of AI Code We Are All Dealing With by Addy Osmani - AI writes code faster than we can review it, and your team's understanding of the codebase quietly shrinks with every merge.&lt;/p&gt;

&lt;p&gt;4️⃣ Why we rolled our own React Server Components framework by Josh Wilson - The Aha! team built their own RSC framework in under 1,000 lines and cut time-to-interactive by over 80%.&lt;/p&gt;

&lt;p&gt;5️⃣ Why we banned React's useEffect by Alvin Sng - Most useEffect usage compensates for things React already handles better, and AI agents are making it worse by adding it "just in case."&lt;/p&gt;

&lt;p&gt;Read the full post here - &lt;a href="https://shrutikapoor.substack.com/p/top-5-in-frontend-and-ai-this-week" rel="noopener noreferrer"&gt;https://shrutikapoor.substack.com/p/top-5-in-frontend-and-ai-this-week&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React 2025 Full Course – Build a Netflix Clone with Tailwind, TanStack Router, TanStack Query &amp; Zustand</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 03 Oct 2025 04:22:36 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/react-2025-full-course-build-a-netflix-clone-with-tailwind-tanstack-router-tanstack-query--4ehc</link>
      <guid>https://dev.to/shrutikapoor08/react-2025-full-course-build-a-netflix-clone-with-tailwind-tanstack-router-tanstack-query--4ehc</guid>
      <description>&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/X2Rcp87yl4s"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>GPT-5 - Hype or Legit Amazing? Front End Developer's honest review</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Tue, 12 Aug 2025 07:27:33 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/gpt-5-hype-or-legit-amazing-nfl</link>
      <guid>https://dev.to/shrutikapoor08/gpt-5-hype-or-legit-amazing-nfl</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UJ2z0Y8Os4s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;New day, New model. GPT-5 is announced, but here's the real question - Does GPT‑5 feel like a genuine leap forward for developers, or is the excitement overblown?&lt;/p&gt;

&lt;p&gt;In this video, I evaluate GPT‑5 specifically within React and JavaScript development workflows, testing how it performs on real-world coding tasks rather than theoretical benchmarks. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is covered in this video -
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Real coding scenarios with React and JS, showing whether GPT-5 generates clean, maintainable code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comparisons against previous models (e.g., GPT-4o or other GPT versions), especially in frontend tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Observations on accuracy, style, and developer usability—does GPT-5 just “work,” or is it still messy or off-target?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A verdict on whether GPT-5 is a practical upgrade for frontend developers, or if the excitement is mostly hype.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>openai</category>
      <category>frontend</category>
    </item>
    <item>
      <title>AI 101 for Frontend Devs: LLMs, Transformers, RAG Explained Simply</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Mon, 21 Jul 2025 08:41:00 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/ai-101-for-frontend-devs-llms-transformers-rag-explained-simply-1n8k</link>
      <guid>https://dev.to/shrutikapoor08/ai-101-for-frontend-devs-llms-transformers-rag-explained-simply-1n8k</guid>
      <description>&lt;p&gt;Lately, AI has become a huge HYPE. But most of the terms floating around feel confusing or too technical. &lt;/p&gt;

&lt;p&gt;LLMs. &lt;br&gt;
Foundation models. &lt;br&gt;
RAG. &lt;br&gt;
Transformers.&lt;br&gt;
MCP&lt;br&gt;
RLHF&lt;/p&gt;

&lt;p&gt;I kept seeing these everywhere and felt like I should understand them, but didn’t. So I took time to actually learn how it all works, and then made a short video explaining everything in plain English with clear visuals, hoping it helps both a tech person and a non-tech person&lt;/p&gt;

&lt;p&gt;Watch this video to see these explanations in detail&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/MfU27Ub-bs4"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here's a quick summary - &lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Layers of the AI Ecosystem
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.1 Hardware:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
At the foundation, companies like Nvidia, AMD, Intel, and Huawei manufacture the physical processors that power AI computation. These chips are the "brain cells" of AI, enabling models to run, train, and perform tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2 Cloud Providers:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Since hardware is expensive, cloud providers such as AWS, Google Cloud, Alibaba, and Microsoft Azure rent out these chips, offering computational resources to others. Think of them as factories providing the necessary tools for building products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.3 Model Builders:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
On top of cloud providers, companies like OpenAI, Anthropic, Hugging Face, Meta, and Google use this computational power to create models—the "brains" of AI systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.4 Applications:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
These models power applications like ChatGPT, Claude, Midjourney, Canva AI, and more, which are the tools users interact with directly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers work on foundational models.&lt;/li&gt;
&lt;li&gt;Users interact with applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the terms in short - &lt;/p&gt;
&lt;h3&gt;
  
  
  2.1 AI
&lt;/h3&gt;

&lt;p&gt;Artificial Intelligence (AI) is a field of computer science focused on making systems that can perform as well as human intelligence. The goal is to create systems that can think, recognize patterns, make predictions, and understand language like humans.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The term "artificial intelligence" was coined in 1956.&lt;/li&gt;
&lt;li&gt;Alan Turing's 1950 paper introduced the "&lt;a href="https://courses.cs.umbc.edu/471/papers/turing.pdf" rel="noopener noreferrer"&gt;imitation game&lt;/a&gt;", now called the Turing test, to see if machines can match human intelligence.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2.2 Machine Learning
&lt;/h3&gt;

&lt;p&gt;Machine learning (ML) is a type of AI where machines learn from data.&lt;br&gt;&lt;br&gt;
Instead of explicit instructions, machines find patterns and make predictions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
If you provide the sequence 2, 4, 6, 8, 10, the model learns the pattern and predicts 12 as the next number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-world ML examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Netflix recommending movies&lt;/li&gt;
&lt;li&gt;Email clients learning to filter spam&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2.3 Neural Networks
&lt;/h3&gt;

&lt;p&gt;Neural networks are popular ML approaches that mimic brain cells.&lt;br&gt;&lt;br&gt;
They consist of layers of "neurons" making yes/no decisions together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
For image recognition (cat vs dog):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input layer: receives the image data&lt;/li&gt;
&lt;li&gt;Hidden layers: process features like fur, legs, facial features, whiskers&lt;/li&gt;
&lt;li&gt;Output layer: predicts, e.g., 85% cat, 15% dog&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2.4 Deep Learning:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Deep Learning&lt;/strong&gt; is a kind of machine learning that uses many layers of neural networks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The more hidden layers there are, the “deeper” the network.&lt;/li&gt;
&lt;li&gt;Deep learning is behind modern speech recognition, image recognition, and natural language processing systems.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  3. AI Terms Simplified
&lt;/h2&gt;
&lt;h3&gt;
  
  
  3.1 Model
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;model&lt;/strong&gt; is the “brain” of an AI system. It’s a core unit trained on data to make predictions, generate content, or solve specific tasks. For example, GPT-4 is a model trained on massive amounts of text, capable of understanding and generating human language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Models are built by companies like OpenAI, Anthropic, Hugging Face, Meta, and Google.&lt;/li&gt;
&lt;li&gt;Think of a model as a trained dog that performs certain tasks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.2 Foundational Models
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Foundational models&lt;/strong&gt; are powerful models trained on enormous datasets—trillions of words, books, and texts. Their strength lies in adaptability: many applications can be built on top of them, either by using them as they are or by fine-tuning for specialized tasks (like medical or customer service applications).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examples: GPT-4 (OpenAI), Claude (Anthropic)&lt;/li&gt;
&lt;li&gt;Analogy: A foundational model is like a guide dog trained with numerous tricks, ready for many situations.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.3 Large Language Models (LLM)
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;LLM&lt;/strong&gt; is a type of model trained specifically on vast text data, excelling at understanding and generating human language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Capabilities: predicting the next word, generating scripts, summarizing text, answering questions.&lt;/li&gt;
&lt;li&gt;Analogy: An LLM is like a dog that understands and responds to commands in multiple human languages.&lt;/li&gt;
&lt;li&gt;Example: ChatGPT is a popular LLM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.4 Generative AI
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Generative AI&lt;/strong&gt; refers to models that can create entirely new content—text, images, music—based on input prompts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example: Given a prompt like “a woman eating cake while riding a camel on a mountaintop,” generative AI can produce a unique image that never existed before.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generative models are not limited to analyzing data; they create new ideas, code, text, and media.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.5 Transformer
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;transformer&lt;/strong&gt; is the architecture that powers modern language models.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It enables models to understand not just individual words, but the context of entire sentences using “attention.”&lt;/li&gt;
&lt;li&gt;Example: In the sentence “The trophy didn’t fit in the suitcase because it was too big,” a transformer helps the AI know “it” refers to the trophy.&lt;/li&gt;
&lt;li&gt;First introduced in the paper “Attention Is All You Need” (2017).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.6 GPT (Generative Pre-trained Transformer)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GPT&lt;/strong&gt; stands for Generative Pre-trained Transformer, the technology behind models like ChatGPT.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generative:&lt;/strong&gt; Can create new content from input.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-trained:&lt;/strong&gt; Trained on large datasets beforehand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transformer:&lt;/strong&gt; Uses the transformer architecture for context and understanding.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.7 Prompts
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;prompt&lt;/strong&gt; is the input or question you give to an AI model (especially an LLM).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The quality of the prompt determines the quality of the output.&lt;/li&gt;
&lt;li&gt;Prompt engineering is the craft of writing clear, informative prompts to get the best results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prompt Types:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-shot:&lt;/strong&gt; No examples, just the question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Few-shot:&lt;/strong&gt; Some examples given to help the model understand context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chain of thought:&lt;/strong&gt; Encourages the model to reason step by step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CRISPR Method for Prompts:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Context, Role, Intent, Specificity, Parameters, Refinement&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.8 Token
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;token&lt;/strong&gt; is a chunk of text (word or part of a word) that the AI processes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More tokens in your prompt = higher computational cost.&lt;/li&gt;
&lt;li&gt;Example: “A cat and a dog” may be four tokens.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3.9 Hallucinations
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hallucinations&lt;/strong&gt; happen when an AI model confidently produces incorrect or made-up answers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always verify AI-generated information.&lt;/li&gt;
&lt;li&gt;Example: Asking an AI for the definition of MCP may yield a wrong answer.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  4. Training Approaches
&lt;/h2&gt;
&lt;h3&gt;
  
  
  4.1 Supervised Learning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; The AI learns from examples that already have the right answers (labels).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; You show the model lots of data with correct answers, like pictures labeled “cat” or “dog.”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; Next time the AI sees a new picture, it can guess if it’s a cat or a dog because it learned from the labeled examples.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4.2 Unsupervised Learning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; The AI is given data without any answers or labels.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; The model looks for patterns and groups in the data all by itself, without anyone telling it what’s right or wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; It can find clusters, trends, or common features in the data (like grouping customers by shopping habits).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4.3 Reinforcement Learning from Human Feedback (RLHF)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; The AI learns by getting feedback from humans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; The model makes a prediction or does a task, and you give it a thumbs up or thumbs down. This feedback helps it improve over time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; The AI gets better at giving useful or correct answers because it learns from the feedback.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4.4 Fine-Tuning
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Making an already trained model smarter for a specific job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; You take a big, general model (like GPT-4) and train it further on special data, like medical texts or legal documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; The AI becomes an expert in a particular area without having to start learning from scratch.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  5. AI Tools
&lt;/h2&gt;
&lt;h3&gt;
  
  
  5.1 RAG (Retrieval Augmented Generation)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; A method to help AI models answer questions more accurately by giving them access to extra information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; Instead of only relying on what the model was trained on, you let the AI “retrieve” specific data (like from a database or document) when you ask a question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result:&lt;/strong&gt; The AI can use up-to-date or company-specific info to give better, more relevant answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Difference from Fine-Tuning:&lt;/strong&gt; RAG doesn’t train the model on new data—it just gives extra info to look up when responding.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  5.2 AI Agents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What they are:&lt;/strong&gt; Software systems that can act autonomously or semi-autonomously to perform tasks using multiple tools or sources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Examples:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;A code editor agent that reviews your work and suggests improvements.&lt;/li&gt;
&lt;li&gt;A travel booking agent that creates an itinerary and recommends hotels.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How autonomous?&lt;/strong&gt; Most agents today help you by gathering information or making recommendations, but don’t fully automate everything. Their independence is expected to grow in the future.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  5.3 MCP (Model Context Protocol)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; A standardized way for AI systems and smart devices to communicate with each other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; Instead of building a custom link for each device or tool, MCP lets different systems talk using agreed-upon rules—making integration easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; MCP helps developers connect their tools to many AI systems without extra work, speeding up innovation and compatibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the video I also explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine learning vs deep learning&lt;/li&gt;
&lt;li&gt;Neural networks&lt;/li&gt;
&lt;li&gt;Prompt engineering&lt;/li&gt;
&lt;li&gt;Tokens and how they affect cost&lt;/li&gt;
&lt;li&gt;Hallucinations&lt;/li&gt;
&lt;li&gt;RLHF (Reinforcement Learning from Human Feedback)&lt;/li&gt;
&lt;li&gt;Agents, MCP, and more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can watch it here:&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/MfU27Ub-bs4"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;Connect with Me:&lt;br&gt;
YouTube: &lt;a href="https://www.youtube.com/@shrutikapoor08" rel="noopener noreferrer"&gt;https://www.youtube.com/@shrutikapoor08&lt;/a&gt;&lt;br&gt;
Keep up in tech with bi-weekly newsletter: &lt;a href="https://substack.com/@shrutikapoor" rel="noopener noreferrer"&gt;https://substack.com/@shrutikapoor&lt;/a&gt;&lt;br&gt;
Discord: bit.ly/shruti-discord&lt;/p&gt;

</description>
      <category>ai</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What tip would you give to someone who wants to get promoted?</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Thu, 19 Jun 2025 08:02:08 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/what-tip-would-you-give-to-someone-who-wants-to-get-promoted-12o4</link>
      <guid>https://dev.to/shrutikapoor08/what-tip-would-you-give-to-someone-who-wants-to-get-promoted-12o4</guid>
      <description></description>
    </item>
    <item>
      <title>React Best Practices: State Management</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 30 May 2025 19:09:45 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/react-best-practices-state-management-37j8</link>
      <guid>https://dev.to/shrutikapoor08/react-best-practices-state-management-37j8</guid>
      <description>&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/c7FQP-tUn1U"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>We are almost about to hit our goal!</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Tue, 25 Feb 2025 23:08:27 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/we-are-almost-about-to-hit-our-goal-558l</link>
      <guid>https://dev.to/shrutikapoor08/we-are-almost-about-to-hit-our-goal-558l</guid>
      <description>&lt;p&gt;I CAN'T KEEP CALM BECAUSE WE ABOUT TO REACH OUR GOAL OF 3000 PEOPLE IN THE TRIBE! &lt;br&gt;
WOHOOOOOO 🎉&lt;/p&gt;

&lt;p&gt;Join the tribe now - &lt;a href="https://youtube.com/shrutikapoor08" rel="noopener noreferrer"&gt;https://youtube.com/shrutikapoor08&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh7uook99iwnd311jvk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh7uook99iwnd311jvk4.png" alt="Image description" width="800" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>community</category>
    </item>
    <item>
      <title>I migrated from Create React App to Vite. Here's what I learnt -</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 21 Feb 2025 22:49:41 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/i-migrated-from-create-react-app-to-vite-heres-what-i-learnt--5epa</link>
      <guid>https://dev.to/shrutikapoor08/i-migrated-from-create-react-app-to-vite-heres-what-i-learnt--5epa</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fcXwlXEXuwA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This week, I migrated an old React 15 Create React App (CRA) project from 2017 to Vite. Here’s what I learned along the way.  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Outdated React Version (React 15)
&lt;/h3&gt;

&lt;p&gt;Vite auto-installs React 19, but my app was still on React 15. I was concerned that I’d need to incrementally upgrade to React 17+ before migrating.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Downgrading Vite’s React version to 15 before migration was straightforward. I simply removed &lt;code&gt;node_modules&lt;/code&gt; and replaced &lt;code&gt;createRoot&lt;/code&gt; with the older &lt;code&gt;ReactDOM.render&lt;/code&gt;.  &lt;/p&gt;
&lt;h3&gt;
  
  
  2. Removing Create React App
&lt;/h3&gt;

&lt;p&gt;The first step was to remove CRA. Since my project was using CRA’s built-in Webpack and Babel settings, I ejected the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx react-scripts eject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This exposed Webpack and Babel configs, making it easier to transition to Vite.  &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Module Import Errors (&lt;code&gt;Cannot use import statement outside a module&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Vite uses ES Modules (ESM), while CRA relied on CommonJS, causing import issues.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;"type": "module"&lt;/code&gt; to &lt;code&gt;package.json&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Updated &lt;code&gt;&amp;lt;script src&amp;gt;&lt;/code&gt; tags in &lt;code&gt;index.html&lt;/code&gt; to include &lt;code&gt;type="module"&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Dependency Vulnerabilities and Security Issues
&lt;/h3&gt;

&lt;p&gt;Running &lt;code&gt;npm audit&lt;/code&gt; revealed 100s of vulnerabilities in dependencies such as &lt;code&gt;postcss&lt;/code&gt; and &lt;code&gt;node-fetch&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removed outdated packages.
&lt;/li&gt;
&lt;li&gt;Ran:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  npm audit fix &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Handling Ejected Configuration Files
&lt;/h3&gt;

&lt;p&gt;Ejecting CRA exposed Webpack and Babel configurations that Vite didn’t need.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Deleted those files to prevent conflicts with Vite.  &lt;/p&gt;

&lt;p&gt;Watch the livestream to see this migration LIVE - &lt;a href="https://www.youtube.com/live/fcXwlXEXuwA" rel="noopener noreferrer"&gt;https://www.youtube.com/live/fcXwlXEXuwA&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>I migrated from Create React App to Vite and took these steps</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 21 Feb 2025 06:53:41 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/i-migrated-from-create-react-app-to-vite-heres-what-i-observed-4b5k</link>
      <guid>https://dev.to/shrutikapoor08/i-migrated-from-create-react-app-to-vite-heres-what-i-observed-4b5k</guid>
      <description>&lt;p&gt;This week, I migrated an old React 15 Create React App (CRA) project from 2017 to Vite. Here’s what I learned along the way.  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Outdated React Version (React 15)
&lt;/h3&gt;

&lt;p&gt;Vite auto-installs React 19, but my app was still on React 15. I was concerned that I’d need to incrementally upgrade to React 17+ before migrating.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Downgrading Vite’s React version to 15 before migration was straightforward. I simply removed &lt;code&gt;node_modules&lt;/code&gt; and replaced &lt;code&gt;createRoot&lt;/code&gt; with the older &lt;code&gt;ReactDOM.render&lt;/code&gt;.  &lt;/p&gt;
&lt;h3&gt;
  
  
  2. Removing Create React App
&lt;/h3&gt;

&lt;p&gt;The first step was to remove CRA. Since my project was using CRA’s built-in Webpack and Babel settings, I ejected the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx react-scripts eject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This exposed Webpack and Babel configs, making it easier to transition to Vite.  &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Module Import Errors (&lt;code&gt;Cannot use import statement outside a module&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Vite uses ES Modules (ESM), while CRA relied on CommonJS, causing import issues.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;"type": "module"&lt;/code&gt; to &lt;code&gt;package.json&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Updated &lt;code&gt;&amp;lt;script src&amp;gt;&lt;/code&gt; tags in &lt;code&gt;index.html&lt;/code&gt; to include &lt;code&gt;type="module"&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Dependency Vulnerabilities and Security Issues
&lt;/h3&gt;

&lt;p&gt;Running &lt;code&gt;npm audit&lt;/code&gt; revealed vulnerabilities in dependencies like &lt;code&gt;postcss&lt;/code&gt; and &lt;code&gt;node-fetch&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removed outdated packages.
&lt;/li&gt;
&lt;li&gt;Ran:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  npm audit fix &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Handling Ejected Configuration Files
&lt;/h3&gt;

&lt;p&gt;Ejecting CRA exposed Webpack and Babel configurations that Vite didn’t need.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Deleted those files to prevent conflicts with Vite.  &lt;/p&gt;

&lt;p&gt;Watch the livestream to see this migration LIVE - &lt;a href="https://www.youtube.com/live/fcXwlXEXuwA" rel="noopener noreferrer"&gt;https://www.youtube.com/live/fcXwlXEXuwA&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create React App is Dead. What does it mean for you?</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Tue, 18 Feb 2025 22:48:34 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/create-react-app-is-dead-what-does-it-mean-for-you-4gp</link>
      <guid>https://dev.to/shrutikapoor08/create-react-app-is-dead-what-does-it-mean-for-you-4gp</guid>
      <description>&lt;p&gt;This is the end of an era: Create React App is officially deprecated.&lt;/p&gt;

&lt;p&gt;It’s been a long time coming. I have preferred Vite for a long time, so much so that I even recorded my &lt;a href="https://www.oreilly.com/library/view/react-fundamentals-building/0636920981428/" rel="noopener noreferrer"&gt;React O'Reilly course with Vite&lt;/a&gt; instead of CRA.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/0p7M2ZMskEI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is CRA deprecated?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;It hasn’t been actively maintained.&lt;/li&gt;
&lt;li&gt;With React 19, it broke things.&lt;/li&gt;
&lt;li&gt;No built-in routing, and the default setup lacks key features.
It’s slow.&lt;/li&gt;
&lt;li&gt;Ejecting has always been a nightmare.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What should you do now?
&lt;/h2&gt;

&lt;p&gt;If you have an app in CRA, migrate it to Vite.  Seriously. It's fast, free, and simple. &lt;a href="https://www.youtube.com/watch?v=5HSfS7i2kZ8" rel="noopener noreferrer"&gt;Check out my guide on setting up React with Vite&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternatives to CRA
&lt;/h2&gt;

&lt;p&gt;If you're looking for options, here are my top picks:&lt;br&gt;
1️⃣ Vite – My go-to for almost everything + with TanStack Router and TanStack Query, it solves most of the problems of vanilla React.&lt;br&gt;
2️⃣ Nx – If you need a monorepo setup.&lt;br&gt;
3️⃣ Next.js, Remix – If you need full-stack capabilities.&lt;br&gt;
4️⃣ Astro – Perfect for marketing/blog sites.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I’m doing:
&lt;/h2&gt;

&lt;p&gt;✅ I’m sticking with Vite for most of my apps.&lt;br&gt;
✅ For routing, TanStack Router is my pick.&lt;br&gt;
✅ For data fetching, TanStack Query all the way.&lt;br&gt;
✅ When I need SSR or Server Components, I’ll reach for Next.js.&lt;/p&gt;

&lt;p&gt;The CRA era is over. What are you switching to? Let me know in the comments.  &lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://shrutikapoor.substack.com/embed" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Ff_auto%2Cq_auto%3Abest%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fshrutikapoor.substack.com%252Ftwitter%252Fsubscribe-card.jpg%253Fv%253D1606216571%2526version%253D9" height="417" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://shrutikapoor.substack.com/embed" rel="noopener noreferrer" class="c-link"&gt;
          Shruti’s Substack | Shruti Kapoor | Substack
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          I share Front End development knowledge through this newsletter, and a picture from my life. Click to read Shruti’s Substack, by Shruti Kapoor, a Substack publication with thousands of subscribers.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Ficons%2Fsubstack%2Ffavicon.ico" width="800" height="400"&gt;
        shrutikapoor.substack.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>coding</category>
    </item>
    <item>
      <title>Steps to Dealing with Overcoming Imposter Syndrome in Tech</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 20 Dec 2024 23:54:40 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/7-steps-to-dealing-with-overcoming-imposter-syndrome-in-tech-4l3g</link>
      <guid>https://dev.to/shrutikapoor08/7-steps-to-dealing-with-overcoming-imposter-syndrome-in-tech-4l3g</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2n6Mu39Q3m4?start=10"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you've ever stared at your code and thought, &lt;em&gt;"I have no idea what I’m doing, and everyone’s going to find out,"&lt;/em&gt; you’re not alone. That nagging self-doubt has a name: &lt;strong&gt;imposter syndrome&lt;/strong&gt;, and it’s something many developers—beginners to seasoned pros—face at some point in their careers.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What Is Imposter Syndrome?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Imposter syndrome is the persistent belief that your skills or successes aren’t real, and you fear being exposed as a fraud. Symptoms might include:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Believing others know more than you.
&lt;/li&gt;
&lt;li&gt;Attributing your success to luck or external factors.
&lt;/li&gt;
&lt;li&gt;Feeling uncomfortable with praise.
&lt;/li&gt;
&lt;li&gt;Fixating on mistakes, even minor ones.
&lt;/li&gt;
&lt;li&gt;Thinking you wouldn’t doubt yourself if you were “better.”
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sound familiar? It’s a heavy weight to carry, especially in an industry where learning never stops.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;My Experience With Imposter Syndrome&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I’ve felt it during daily tasks like debugging code, submitting pull requests, or tackling a new language. Even during moments of growth—like hosting Fireside Chats with amazing developers—I’ve questioned whether I was truly qualified.  &lt;/p&gt;

&lt;p&gt;Here’s the thing: imposter syndrome doesn’t discriminate. I’ve had mentors and peers, people I look up to, share similar doubts. The first step toward beating it is realizing that you’re not alone.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;How to Beat Imposter Syndrome&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Overcoming imposter syndrome isn’t about eliminating it entirely; it’s about learning to manage it. Here are strategies that worked for me:  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. Acknowledge the Feeling&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;When self-doubt strikes, pause and remind yourself: &lt;em&gt;“This is imposter syndrome talking. It doesn’t define my abilities.”&lt;/em&gt; Naming the feeling is the first step toward breaking its hold.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;2. Reframe Negative Thoughts&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;When fear tells you &lt;em&gt;“I can’t do this,”&lt;/em&gt; respond with, &lt;em&gt;“I don’t know how to do this yet, but I’ll learn.”&lt;/em&gt; Viewing challenges as growth opportunities shifts your mindset.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;3. Break Down the Cause&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Ask yourself:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What’s triggering these feelings?
&lt;/li&gt;
&lt;li&gt;What’s your fear saying?
&lt;/li&gt;
&lt;li&gt;Is there any evidence to support it?
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This reflective practice helps you uncover the root of your doubts and take actionable steps to move forward.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;4. Celebrate Evident Success&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Track your wins—big and small. Fixed a tricky bug? Mastered a new tool? Write it down. Build a list of your achievements and testimonials to remind yourself of how far you’ve come.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;5. Keep Learning&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Feelings of inadequacy often stem from the unknown. Push back by taking action—learn something new, seek out resources, or ask questions.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;6. Find Your Support System&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Surround yourself with people who uplift you:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;loved one&lt;/strong&gt; who encourages you.
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;mentor&lt;/strong&gt; who guides you.
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;therapist&lt;/strong&gt; who helps you heal.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Community matters, whether it’s peers at work, online coding groups, or mentors who’ve walked your path.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Your Journey Matters&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Imposter syndrome is a sign that you’re stepping out of your comfort zone and growing—a journey worth celebrating. Overcoming it is an ongoing process, but every step forward strengthens your confidence.  &lt;/p&gt;

&lt;p&gt;Have you dealt with imposter syndrome? Share your story in the comments, or connect with me on Discord, Twitter, or Instagram. Remember, you’re not alone, and you’ve got this.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep coding, keep growing.&lt;/strong&gt; You are stronger than you think!  &lt;/p&gt;




&lt;h3&gt;
  
  
  Connect with Me:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;YouTube:&lt;/strong&gt; &lt;a href="https://www.youtube.com/@shrutikapoor08" rel="noopener noreferrer"&gt;https://www.youtube.com/@shrutikapoor08&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discord:&lt;/strong&gt; &lt;a href="//bit.ly/shruti-discord"&gt;bit.ly/shruti-discord&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Twitter:&lt;/strong&gt; &lt;a href="https://x.com/shrutikapoor08" rel="noopener noreferrer"&gt;@shrutikapoor08&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instagram:&lt;/strong&gt; &lt;a href="https://www.instagram.com/itsshrutikapoor/" rel="noopener noreferrer"&gt;@itsshrutikapoor&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>React 19 Actions - Simplifying form submission and loading states</title>
      <dc:creator>Shruti Kapoor</dc:creator>
      <pubDate>Fri, 05 Jul 2024 08:27:29 +0000</pubDate>
      <link>https://dev.to/shrutikapoor08/react-19-actions-simplifying-form-submission-and-loading-states-2idc</link>
      <guid>https://dev.to/shrutikapoor08/react-19-actions-simplifying-form-submission-and-loading-states-2idc</guid>
      <description>&lt;p&gt;React 19 introduces Actions, which are asynchronous functions. Actions are helpful in making form submissions easier. This blog post dives into what Actions are and how to use them.&lt;/p&gt;

&lt;p&gt;In this blog post, we are going to learn about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The new React 19 feature - Actions&lt;/li&gt;
&lt;li&gt;The new React 19 hooks - useActionState and useFormStatus&lt;/li&gt;
&lt;li&gt;Converting a React 18 form to a React 19 form&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Feature: React Actions
&lt;/h2&gt;

&lt;p&gt;To understand Actions, let's first take a look at how we manage forms today. In React 18 and earlier, we submit forms using the &lt;code&gt;handleSubmit&lt;/code&gt; function in a button. Here's a simple form that has one input field &lt;code&gt;name&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Form submission in React 18&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;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;React 18 form&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isPending&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsPending&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&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;handleChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;setIsPending&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// call API&lt;/span&gt;
    &lt;span class="nf"&gt;setIsPending&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&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="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isPending&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello in React 18, &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmit&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isPending&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Update
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, we are doing the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding a Loading State: We use a variable isPending to manually keep track of the loading state.&lt;/li&gt;
&lt;li&gt;Form Submission: The form is submitted using the handleSubmit event handler attached to the onClick event of the button.&lt;/li&gt;
&lt;li&gt;Capturing Submitted Value: The handleChange function captures the submitted value and stores it in state variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Actions
&lt;/h2&gt;

&lt;p&gt;With React 19, handling forms becomes easier with Actions, inspired by frameworks such as Remix. One key feature is the enhanced use of startTransition to manage pending states.&lt;/p&gt;

&lt;p&gt;startTransition was introduced in React 18, allowing developers to mark certain updates as less urgent. In React 19, startTransition can now handle async functions, making it even more powerful for managing asynchronous tasks and improving the user experience during form submissions.&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isPending&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransition&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;handleSubmit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;updateName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&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;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&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="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;This async function inside &lt;code&gt;startTransition&lt;/code&gt; is called Action. What makes them cool is that actions can be used directly to submit forms like so -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"{actionFn}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This format may look familiar if you are experienced with PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create an action?
&lt;/h2&gt;

&lt;p&gt;To create an async function, we can use a new hook introduced in React 19 - &lt;code&gt;useActionState&lt;/code&gt;. We call this hook and pass in an action function and an initial state. This hook returns the updated state and a form action &lt;code&gt;actionFn&lt;/code&gt;, which can be used to wire up a form.&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;actionFn&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useActionState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;submitAction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&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 with this wired up with the form, we have -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;actionFn&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"{pending}"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    Update
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To add a loading state, we can use a new hook introduced in React 19 called &lt;code&gt;useFormStatus&lt;/code&gt;.&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pending&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="nx"&gt;method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This hook provides information on the status of the form. The &lt;code&gt;pending&lt;/code&gt; state indicates whether the form is being submitted, and &lt;code&gt;data&lt;/code&gt; is a &lt;code&gt;FormData&lt;/code&gt; object containing the submitted data. We use this pending state to show a loader. However, there is one caveat - this hook can only be used in a child component, not in the form itself. So, we have to create child components SubmitButton and Loader to retrieve &lt;code&gt;pending&lt;/code&gt; state:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Loader&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pending&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&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;pending&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Loading...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;SubmitButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pending&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return &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;button&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;submit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;disabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pending&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;Update&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&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="k"&gt;return&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;form&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Loader&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SubmitButton&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also capture useful information about the data submitted to the form by retrieving it from the state returned from &lt;code&gt;useActionState&lt;/code&gt;.&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useActionState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;submitAction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&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;So here's the final form -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Loader&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pending&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pending&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Loading...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;SubmitButton&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pending&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useFormStatus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;pending&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Update
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;name&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello in 19 &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&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;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;React 19 form&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useActionState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;submitAction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;formAction&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Loader&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SubmitButton&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Name&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&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;Compare this with React 18 form at the top of this post to check the difference.&lt;/p&gt;

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

&lt;p&gt;By utilizing actions along with hooks like &lt;code&gt;useActionState&lt;/code&gt; and &lt;code&gt;useFormStatus&lt;/code&gt;, we can easily manage form states, capture submitted data, and provide responsive feedback to users during form submissions to show pending states. I am excited for this improved experience of handling forms in React 19, and I look forward to removing unnecessary &lt;code&gt;handleSubmits&lt;/code&gt;, &lt;code&gt;useState&lt;/code&gt;s and &lt;code&gt;pending&lt;/code&gt; state.&lt;/p&gt;

&lt;p&gt;In my next blog post, I will discuss an exciting new React feature - the React Compiler. This tool automatically memoizes, eliminating the need for useMemo and useCallback. Stay updated and get it directly in your inbox by &lt;a href="https://shrutikapoor.substack.com/"&gt;joining my newsletter&lt;/a&gt;.&lt;/p&gt;

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