<?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: Yogesh Kumar</title>
    <description>The latest articles on DEV Community by Yogesh Kumar (@yogesh0333).</description>
    <link>https://dev.to/yogesh0333</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%2F3821472%2F90c11437-265d-4521-8d31-143bb7738271.jpeg</url>
      <title>DEV Community: Yogesh Kumar</title>
      <link>https://dev.to/yogesh0333</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yogesh0333"/>
    <language>en</language>
    <item>
      <title>5 Mistakes I Made While Building React and Next.js Applications</title>
      <dc:creator>Yogesh Kumar</dc:creator>
      <pubDate>Mon, 16 Mar 2026 08:17:33 +0000</pubDate>
      <link>https://dev.to/yogesh0333/5-mistakes-i-made-while-building-react-and-nextjs-applications-2le6</link>
      <guid>https://dev.to/yogesh0333/5-mistakes-i-made-while-building-react-and-nextjs-applications-2le6</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;Over the past few years I’ve worked on several projects using &lt;strong&gt;React, React Native and more recently Next.js&lt;/strong&gt;. While building real production applications, I made quite a few mistakes that taught me valuable lessons.&lt;/p&gt;

&lt;p&gt;I wanted to share a few of them here. Maybe they can save someone else some debugging time.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Not thinking about project structure early
&lt;/h2&gt;

&lt;p&gt;When starting a project, it's tempting to move fast and not worry too much about folder structure. I did this in a few projects.&lt;/p&gt;

&lt;p&gt;Everything worked fine at the beginning, but as the codebase grew it became harder to maintain.&lt;/p&gt;

&lt;p&gt;Files were scattered, components became large, and new developers struggled to understand the code.&lt;/p&gt;

&lt;p&gt;Later we reorganized the project into clearer folders like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;components&lt;/li&gt;
&lt;li&gt;hooks&lt;/li&gt;
&lt;li&gt;services&lt;/li&gt;
&lt;li&gt;utils&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, navigating the project became much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Fetching data the wrong way in Next.js
&lt;/h2&gt;

&lt;p&gt;When I first started working with Next.js, I treated it like a normal React app and fetched most data on the client side.&lt;/p&gt;

&lt;p&gt;But later I realized some pages loaded slower than necessary.&lt;/p&gt;

&lt;p&gt;For pages that needed fast loading or SEO, fetching data &lt;strong&gt;on the server side&lt;/strong&gt; worked much better.&lt;/p&gt;

&lt;p&gt;Understanding when to use server-side data fetching versus client-side fetching made a big difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Ignoring caching for API calls
&lt;/h2&gt;

&lt;p&gt;Another mistake I made earlier was not thinking about caching API requests.&lt;/p&gt;

&lt;p&gt;In some applications the UI made the same API request multiple times, which slowed things down and increased server load.&lt;/p&gt;

&lt;p&gt;After introducing &lt;strong&gt;TanStack Query (React Query)&lt;/strong&gt; for API management, things improved a lot.&lt;/p&gt;

&lt;p&gt;It handled caching, loading states, and retries in a much cleaner way.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Not paying attention to loading and error states
&lt;/h2&gt;

&lt;p&gt;In early versions of some apps I built, the UI didn’t handle loading states very well.&lt;/p&gt;

&lt;p&gt;Sometimes users would see blank screens while data was loading, which made the app feel broken.&lt;/p&gt;

&lt;p&gt;Now I try to always think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;loading indicators&lt;/li&gt;
&lt;li&gt;skeleton UI&lt;/li&gt;
&lt;li&gt;proper error messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These small things make the app feel much more polished.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Spending too much time debugging the wrong thing
&lt;/h2&gt;

&lt;p&gt;One thing I learned the hard way is that many bugs are actually &lt;strong&gt;simple configuration issues&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;incorrect environment variables&lt;/li&gt;
&lt;li&gt;wrong API URLs&lt;/li&gt;
&lt;li&gt;missing headers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now whenever something breaks, the first thing I check is the &lt;strong&gt;Network tab and request data&lt;/strong&gt; before digging deeper into the code.&lt;/p&gt;

&lt;p&gt;It saves a lot of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Building production applications teaches you a lot more than tutorials.&lt;/p&gt;

&lt;p&gt;Mistakes are part of the process, and every project improves your understanding of how to structure applications and solve problems.&lt;/p&gt;

&lt;p&gt;I’m still learning and improving every day.&lt;/p&gt;

&lt;p&gt;If you’ve worked on React or Next.js projects, I’d be interested to hear what mistakes taught you the most.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>react</category>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Handling API Data in Next.js: Things I Learned While Working on Real Projects</title>
      <dc:creator>Yogesh Kumar</dc:creator>
      <pubDate>Sun, 15 Mar 2026 07:11:46 +0000</pubDate>
      <link>https://dev.to/yogesh0333/handling-api-data-in-nextjs-things-i-learned-while-working-on-real-projects-2pic</link>
      <guid>https://dev.to/yogesh0333/handling-api-data-in-nextjs-things-i-learned-while-working-on-real-projects-2pic</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;Over the past few years I’ve mostly worked with &lt;strong&gt;React and React Native&lt;/strong&gt;, but more recently I started working more with &lt;strong&gt;Next.js&lt;/strong&gt; for web applications.&lt;/p&gt;

&lt;p&gt;One area where I learned a lot was &lt;strong&gt;handling API data in production applications&lt;/strong&gt;. In tutorials everything looks simple, but in real projects things become a bit more complicated.&lt;/p&gt;

&lt;p&gt;I wanted to share a few things that helped me while working on Next.js applications that rely heavily on APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choosing the right data fetching approach
&lt;/h2&gt;

&lt;p&gt;One thing that confused me at the beginning was &lt;strong&gt;when to fetch data on the server and when to fetch it on the client&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Next.js gives several options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server components&lt;/li&gt;
&lt;li&gt;Client-side fetching&lt;/li&gt;
&lt;li&gt;API routes&lt;/li&gt;
&lt;li&gt;Static generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first I used &lt;strong&gt;client-side fetching for almost everything&lt;/strong&gt; because it was similar to how I worked with React.&lt;/p&gt;

&lt;p&gt;But later I realized that some pages worked much better when data was fetched on the &lt;strong&gt;server side&lt;/strong&gt;, especially pages that needed fast loading and good SEO.&lt;/p&gt;

&lt;p&gt;Now I usually think about these questions first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the page need SEO?&lt;/li&gt;
&lt;li&gt;Does the data change frequently?&lt;/li&gt;
&lt;li&gt;Does the page require user interaction?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps decide the best approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Managing API calls properly
&lt;/h2&gt;

&lt;p&gt;In a few projects we noticed that the UI was making &lt;strong&gt;too many API requests&lt;/strong&gt;, especially when users navigated between pages.&lt;/p&gt;

&lt;p&gt;This caused unnecessary loading states and sometimes slower performance.&lt;/p&gt;

&lt;p&gt;To improve this, we started using &lt;strong&gt;TanStack Query (React Query)&lt;/strong&gt; for managing API data.&lt;/p&gt;

&lt;p&gt;This helped us with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;caching API responses&lt;/li&gt;
&lt;li&gt;reducing duplicate requests&lt;/li&gt;
&lt;li&gt;better handling of loading and error states&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After introducing it, the application felt much smoother.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Handling loading states carefully
&lt;/h2&gt;

&lt;p&gt;One mistake I made earlier was &lt;strong&gt;not thinking enough about loading states&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes the UI would look empty while waiting for API data, which made the application feel broken.&lt;/p&gt;

&lt;p&gt;Now I usually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;show skeleton loaders&lt;/li&gt;
&lt;li&gt;display clear loading indicators&lt;/li&gt;
&lt;li&gt;handle errors gracefully&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These small UI details improve the overall experience a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Debugging API issues
&lt;/h2&gt;

&lt;p&gt;One thing that always happens in real projects is &lt;strong&gt;unexpected API errors&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes the issue is in the frontend, sometimes in the backend, and sometimes it's just a configuration problem.&lt;/p&gt;

&lt;p&gt;When debugging API issues I usually follow a simple process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the &lt;strong&gt;Network tab in the browser&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Verify request headers and payload&lt;/li&gt;
&lt;li&gt;Test the API in &lt;strong&gt;Postman or curl&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Check backend logs if possible&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Many times the issue turns out to be something simple like a missing header or incorrect request body.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Environment variables and deployment
&lt;/h2&gt;

&lt;p&gt;Another issue I ran into was &lt;strong&gt;APIs working locally but failing in production&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In many cases the problem was related to &lt;strong&gt;environment variables&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now I always double-check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.env.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;deployment environment variables&lt;/li&gt;
&lt;li&gt;API base URLs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This avoids a lot of confusion during deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Working with Next.js in production taught me that handling API data properly is just as important as writing good UI code.&lt;/p&gt;

&lt;p&gt;Frameworks make many things easier, but real-world applications always introduce small challenges that you only learn by experience.&lt;/p&gt;

&lt;p&gt;I’m still learning better patterns for structuring applications and managing data efficiently.&lt;/p&gt;

&lt;p&gt;If you’ve worked on Next.js projects, I’d be curious to hear what challenges you faced while handling APIs.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Things I Learned While Integrating APIs in Next.js Projects</title>
      <dc:creator>Yogesh Kumar</dc:creator>
      <pubDate>Sun, 15 Mar 2026 07:09:33 +0000</pubDate>
      <link>https://dev.to/yogesh0333/things-i-learned-while-integrating-apis-in-nextjs-projects-5b86</link>
      <guid>https://dev.to/yogesh0333/things-i-learned-while-integrating-apis-in-nextjs-projects-5b86</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;Over the last few months I worked on a few projects using &lt;strong&gt;Next.js with REST APIs&lt;/strong&gt;. One thing I realized is that integrating APIs in real applications is very different from small demo projects.&lt;/p&gt;

&lt;p&gt;There are many small issues that come up which you usually don't notice when learning Next.js for the first time.&lt;/p&gt;

&lt;p&gt;I wanted to share a few things I learned while dealing with these situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. CORS problems happen more often than expected
&lt;/h2&gt;

&lt;p&gt;One issue I ran into multiple times was &lt;strong&gt;CORS errors when calling APIs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes the API worked perfectly in Postman but failed in the browser.&lt;/p&gt;

&lt;p&gt;At first it was confusing, but later I realized that the browser blocks requests if the backend doesn't allow the origin.&lt;/p&gt;

&lt;p&gt;In some cases we solved this by updating backend headers, and in other cases we used &lt;strong&gt;Next.js API routes as a proxy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That helped avoid the CORS issue completely.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Debugging API requests is easier with simple tools
&lt;/h2&gt;

&lt;p&gt;While debugging API issues, I started using a few simple techniques:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;checking the &lt;strong&gt;network tab&lt;/strong&gt; carefully&lt;/li&gt;
&lt;li&gt;logging request and response data&lt;/li&gt;
&lt;li&gt;testing APIs separately in Postman&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many times the problem was actually small, like a missing header or incorrect request body.&lt;/p&gt;

&lt;p&gt;These small checks saved a lot of time.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Handling loading and error states properly
&lt;/h2&gt;

&lt;p&gt;When building real user interfaces, API calls don't always succeed.&lt;/p&gt;

&lt;p&gt;Sometimes the request takes longer than expected or fails completely.&lt;/p&gt;

&lt;p&gt;Using &lt;strong&gt;TanStack Query (React Query)&lt;/strong&gt; helped a lot with this. It made handling loading states, caching, and retries much easier compared to writing custom logic every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Environment variables matter in production
&lt;/h2&gt;

&lt;p&gt;Another thing I learned while deploying Next.js apps was the importance of &lt;strong&gt;environment variables&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes an API worked locally but failed in production because the environment variables were not configured correctly.&lt;/p&gt;

&lt;p&gt;Now I always double-check &lt;code&gt;.env&lt;/code&gt; files and deployment settings before debugging deeper issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Working with Next.js in production applications taught me that most problems are not about the framework itself but about &lt;strong&gt;API integration, debugging, and handling real-world edge cases&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Each project teaches something new, and I'm still learning better ways to structure and debug applications.&lt;/p&gt;

&lt;p&gt;If you have worked on Next.js projects and faced similar API issues, I would be interested to hear how you solved them.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>A Few Things I Learned While Working with Next.js in Real Projects</title>
      <dc:creator>Yogesh Kumar</dc:creator>
      <pubDate>Sun, 15 Mar 2026 07:05:35 +0000</pubDate>
      <link>https://dev.to/yogesh0333/a-few-things-i-learned-while-working-with-nextjs-in-real-projects-4igb</link>
      <guid>https://dev.to/yogesh0333/a-few-things-i-learned-while-working-with-nextjs-in-real-projects-4igb</guid>
      <description>&lt;p&gt;Hi everyone,&lt;br&gt;
After working mostly with React projects, I recently spent more time working with Next.js in production applications. I liked many things about it, but I also learned a few lessons while building real features.&lt;/p&gt;

&lt;p&gt;I thought I would share a few of them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Folder structure becomes important very quickly&lt;/strong&gt;&lt;br&gt;
When a Next.js project is small, everything feels simple. But as the project grows, it can become messy if there is no clear structure.&lt;br&gt;
In one project we had pages, components, hooks, and API logic mixed in many places.&lt;br&gt;
Later we organized things better:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;components&lt;/li&gt;
&lt;li&gt;hooks&lt;/li&gt;
&lt;li&gt;services&lt;/li&gt;
&lt;li&gt;utilities&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It made the code much easier to navigate for the team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Server vs Client components can be confusing at first&lt;/strong&gt;&lt;br&gt;
One thing that confused me in the beginning was when to use server components and when to use client components.&lt;br&gt;
Sometimes I accidentally used a hook in a server component and the build failed.&lt;br&gt;
After some time I started following a simple rule:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Server components for data and layout&lt;/li&gt;
&lt;li&gt;Client components for interactivity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That helped avoid many issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Data fetching strategy matters Next.js gives many ways to fetch data:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;server-side&lt;/li&gt;
&lt;li&gt;static&lt;/li&gt;
&lt;li&gt;client-side&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At first I used client-side fetching for many pages. Later I realized some pages worked better with server-side fetching for SEO and faster first load.&lt;br&gt;
Choosing the right method really affects performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Performance improvements come almost for free&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing I like about Next.js is that many optimizations are built-in.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;automatic code splitting&lt;/li&gt;
&lt;li&gt;image optimization&lt;/li&gt;
&lt;li&gt;better routing
These small things make a big difference in production apps.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;Working with Next.js feels very productive once you understand the basics and structure your project well.&lt;/p&gt;

&lt;p&gt;I’m still learning new patterns, but overall it has been a great experience building real applications with it.&lt;/p&gt;

&lt;p&gt;If you have worked with Next.js in production, I’d be interested to hear what challenges you faced.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Few Things I Learned While Working on Real React Projects</title>
      <dc:creator>Yogesh Kumar</dc:creator>
      <pubDate>Fri, 13 Mar 2026 05:22:55 +0000</pubDate>
      <link>https://dev.to/yogesh0333/a-few-things-i-learned-while-working-on-real-react-projects-4i4c</link>
      <guid>https://dev.to/yogesh0333/a-few-things-i-learned-while-working-on-real-react-projects-4i4c</guid>
      <description>&lt;p&gt;Hi everyone,&lt;br&gt;
I have been working as a frontend developer for a few years now, mainly with React, React Native, Next.js and TypeScript. During this time I worked on different kinds of apps like mobile apps, dashboards and even an OTT platform.&lt;br&gt;
I just wanted to share a few things I learned while working on real projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.A messy codebase makes everything harder&lt;/strong&gt;&lt;br&gt;
In one of the projects I joined, the codebase had grown very quickly and there was no clear structure. Components were large and many things were mixed together.&lt;br&gt;
Adding even a small feature sometimes took much longer than expected.&lt;br&gt;
Later we started breaking components into smaller pieces and making them reusable. We also added better folder structure and TypeScript types. Things became much easier after that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.API handling affects performance a lot&lt;/strong&gt;&lt;br&gt;
In some mobile apps we noticed screens were loading slowly. After checking the code we realized the problem was not the UI but how APIs were being handled.&lt;br&gt;
We started using TanStack Query (React Query) for better data fetching and caching. That helped reduce unnecessary API calls and the app felt much faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Communication with backend teams is really important&lt;/strong&gt;&lt;br&gt;
Sometimes frontend developers start building features without fully understanding the API responses. I have seen this cause a lot of rework.&lt;br&gt;
Now I always try to discuss API structure with backend developers early. It saves a lot of time later.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;br&gt;
One thing I learned is that building production apps is very different from small demo projects.&lt;br&gt;
Clean code structure, good communication and simple UI decisions make a big difference.&lt;/p&gt;

&lt;p&gt;I’m still learning and improving every day. If you have faced similar challenges while working with React or React Native, I would love to hear your experience.&lt;br&gt;
Thanks for reading.&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>nextjs</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
