<?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>Forem: Rohit Bhetal</title>
    <description>The latest articles on Forem by Rohit Bhetal (@rohitbhetal).</description>
    <link>https://forem.com/rohitbhetal</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%2F2938701%2F6e0a0bb2-87a7-4269-b1e5-bbd72e9ecf5c.jpeg</url>
      <title>Forem: Rohit Bhetal</title>
      <link>https://forem.com/rohitbhetal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rohitbhetal"/>
    <language>en</language>
    <item>
      <title>Day 1 of Learning Next js -Introduction</title>
      <dc:creator>Rohit Bhetal</dc:creator>
      <pubDate>Sat, 15 Mar 2025 07:50:56 +0000</pubDate>
      <link>https://forem.com/rohitbhetal/day-1-of-learning-next-js-introduction-2ngb</link>
      <guid>https://forem.com/rohitbhetal/day-1-of-learning-next-js-introduction-2ngb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why learn Next.js&lt;/strong&gt;&lt;br&gt;
It simplifies production ready building of web apps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Routing: No third party Routing packages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Api routes: We can build frontend and backend code in same project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rendering:It supports both client side and server side rendering support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Fetching: It supports inbuilt async function&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styling: Supports css , tailwind and other styling libraries for better styling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimization:Provides optimization for images,fonts,scripts etc enhancing user experience&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dev and prod build system: Comes with optimized dev and prod built system,No more dealing with complex configuration&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Create Next app
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;File Structure:&lt;/p&gt;

&lt;p&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%2Fb9j1znmjxl9gvi3kjydz.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%2Fb9j1znmjxl9gvi3kjydz.png" alt="Image description" width="280" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Package.json File:&lt;br&gt;
Its Pretty much Similar to Normal react Project with eslint and build scripts&lt;/p&gt;

&lt;p&gt;Different others files and folder get generated automatically like node_modules, .next which is a build file for the next app and the app file.We will talk about others in future posts.&lt;/p&gt;
&lt;h2&gt;
  
  
  React Server Components(RSC)
&lt;/h2&gt;

&lt;p&gt;Its a new architecture that was introduced by the React team and quicklu adopted by next.js.Its divided into two distinct types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Server Components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Client Components&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By default next.js treats all components as a server components.This components can performs server side tasks like fetching data and fs operations etc.The trade-off is that they cant use react hooks or handle user interaction.For creation of client component we have to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use client";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on top of your file.It wont be able to perform server side task, think of it as traditional react components you're already familiar with.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>learning</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
