<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by rahul more on Medium]]></title>
        <description><![CDATA[Stories by rahul more on Medium]]></description>
        <link>https://medium.com/@morerahul620?source=rss-ab0b7572a279------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*E11i4u0h13kZEG_l</url>
            <title>Stories by rahul more on Medium</title>
            <link>https://medium.com/@morerahul620?source=rss-ab0b7572a279------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:11:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@morerahul620/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Next Auth setup in Next.js with google provider (App Router).]]></title>
            <link>https://medium.com/@morerahul620/next-auth-setup-in-next-js-with-google-provider-app-router-d19c67a4ca16?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/d19c67a4ca16</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[next]]></category>
            <category><![CDATA[nextauth]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 02:32:19 GMT</pubDate>
            <atom:updated>2024-07-16T14:19:45.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>NextAuth setup in Next.js with google provider (App Router).</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmI2SceZRK9uSnjzsCczew.png" /><figcaption><a href="https://next-auth-example.vercel.app/">https://next-auth-example.vercel.app/</a></figcaption></figure><h3>What is NextAuth.js?</h3><p>NextAuth.js is a complete <strong>open-source</strong> authentication solution for Next.js applications. It is designed to handle authentication in a flexible and secure manner, providing support for various authentication methods including OAuth, JWT, and Email.</p><h4>Step 1: Installing next auth</h4><blockquote><em>npm install next-auth</em></blockquote><h4>Step 2: Add auth API route — src/app/api/auth/[…nextauth]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iMzAxbyg1tedzbAfCJpjA.png" /></figure><h4>Step 3: route.js setup</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6576bcbdb4f25cce6c7bf520f5f77eb2/href">https://medium.com/media/6576bcbdb4f25cce6c7bf520f5f77eb2/href</a></iframe><p><em>read more about options — </em><a href="https://next-auth.js.org/configuration/options"><em>https://next-auth.js.org/configuration/options</em></a></p><h4>Step 4: Configure shared session state.</h4><p>Creating a new file called <strong>nextauth-session-provider.js </strong>in either component or utils folder(or any other folder).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9794b0ecf33b3897916c6312543dae97/href">https://medium.com/media/9794b0ecf33b3897916c6312543dae97/href</a></iframe><blockquote>Note — <strong>layout.js</strong> is a server side component, Hence create a seperate file to wrap children inside it and mark it as a client s-c. Import <strong>nextauth-session-provider.js </strong>in layout.js.</blockquote><h4>Step 5: Wrapping layout.js with AuthProvider.</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0cdc546641a8c9474c1b94b080713cec/href">https://medium.com/media/0cdc546641a8c9474c1b94b080713cec/href</a></iframe><h3>Lets get GOOGLE_ID &amp; GOOGLE_SECRET</h3><h4>Step 6: Create a Google Developer Project and get keys</h4><ol><li>Go to the Google Cloud Console.</li></ol><p><em>open this link </em>— <a href="https://console.cloud.google.com/welcome?project=nul">https://console.cloud.google.com/welcome?project=nul</a></p><p>a) click on — select a project dropdown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS0yXD2ai4Jei15M2VkSfw.png" /></figure><p>b)click on — new project (top right)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sKUX9_TQqQjFF9LZezPXw.png" /></figure><p>c)click on — create a new project (top right)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xSZkpVg_m8eHNy-7SdAkg.png" /></figure><p>d)click on — API &amp; Services/credentials (left sidebar)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NY1Ldgh924pGBr2ZaYPcgA.png" /></figure><p>e)click on — Create credentials (top middle)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ojQKERmJ0xsvN_nt-TFZA.png" /></figure><p>f)click on — OAuth client ID</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IY3gBu9vjoVf6mpDNNpBA.png" /></figure><p>g) fill details -copy paste same</p><blockquote>Note — for <strong>production</strong> instead of localhost put domain url - <a href="https://{your_domain}/api/auth/callback/google">https://{YOUR_DOMAIN}/api/auth/callback/google</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWVq4uw0LpK1nhIw9Wf1bw.png" /></figure><p>h)Copy client ID and Client Secret and put into <strong>.env.local.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtSy5Hz5Ey8T2MH1wuAvEQ.png" /></figure><h4><strong>Step 7 : Use session info into your web app eg- in navbar login button.</strong></h4><p>Note- line 1 importing the hook, line 4 de-structuring session, line 8,9 and 16 for utilisation of auth session.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab4ee7f51569f1d7f39e243be863de40/href">https://medium.com/media/ab4ee7f51569f1d7f39e243be863de40/href</a></iframe><p>This guide provided you with the necessary steps to set up and customize authentication using NextAuth.js with Google as the provider. With this setup, you can extend the functionality to support other providers and add additional customisations as per your application needs.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d19c67a4ca16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to know total users visited to your website deployed on vercel.]]></title>
            <link>https://medium.com/@morerahul620/how-to-know-total-users-visited-to-your-website-deployed-on-vercel-c138fcbfd35d?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/c138fcbfd35d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[vercel]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Sat, 20 Jan 2024 18:37:35 GMT</pubDate>
            <atom:updated>2024-01-20T18:37:35.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to know users visited to your website deployed on versel.</h3><h3>Introduction</h3><p>In today’s digital landscape, understanding user engagement is crucial for website owners and developers. If you’ve deployed your website on Vercel, the platform provides insightful tools to help you monitor and analyze user activity. In this blog post, we’ll guide you through the process of tracking user counts on websites hosted on Vercel.</p><h3>Let’s go through step by step.</h3><p>Note — You should have a website already deployed on vercel.For this blog i am taking example of my own portfolio website which is —</p><p><a href="https://dark-portfolio-one.vercel.app/">https://dark-portfolio-one.vercel.app/</a></p><h4>Step 1: Visit vercel dashboard</h4><p>Go to — <a href="https://vercel.com/dashboard">https://vercel.com/dashboard</a></p><h4>Step 2: Visit vercel dashboard</h4><p>Click on your project eg. dark-portfolio (its underlined above your project link)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vezO_khXen7IIRPAX82SMA.png" /></figure><h4>Step 3: Go to Analytics tab from sub nav of dashboard.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCsRuY4JqZUCd_TncyBcGw.png" /></figure><p>a) Now after above screen click on next. b) Cilck on enable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qeTtza0a1TmLBBly-esmzQ.png" /></figure><h4>Step 4: IMP STEP Installation of vercel analytics into your project.</h4><p>a) Go to your deployed project code at local (we need to have some installation and updates). In your project open terminal in vs code.</p><blockquote><em>npm i </em><a href="http://twitter.com/vercel/analytics"><em>@vercel/analytics</em></a></blockquote><p>b) Inside your <strong>layout.js/layout.ts</strong> ,put <strong>&lt;Analytics /&gt;</strong> component between {children} and body. (Only change is at line 11 and one import of that component).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmQ3ZWq5XO7m4UAbFxFP6g.png" /></figure><p>Now push your changes to your deployed branch on github.</p><h4>Step 5: Again Go to vercel analytics (<a href="https://vercel.com/dashboard">https://vercel.com/dashboard</a>)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cjeun0YlwSJHgy1y0dycKQ.png" /></figure><p>Now you will be able to see the no of visitors and page views on your website.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c138fcbfd35d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add favicon in Next.js 13/14]]></title>
            <link>https://medium.com/@morerahul620/how-to-add-favicon-in-next-js-13-14-710635ff839c?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/710635ff839c</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[app-router]]></category>
            <category><![CDATA[favicon]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 13:33:27 GMT</pubDate>
            <atom:updated>2024-01-20T18:49:20.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*xVuUgAxrkWfqhQMw" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLZlR0rnFKulVRPEvKdHuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*WIzfTuAXohxT55TZWlLEng.png" /><figcaption><a href="https://nextjs.org/docs/app/api-reference/file-conventions/metadata/app-icons">https://nextjs.org/docs/app/api-reference/file-conventions/metadata/app-icons</a></figcaption></figure><blockquote>Note — keep your image inside public folder ( in my case its inside public/images/rahul.png)</blockquote><h4>There are 2 ways to add favicon in nextjs app</h4><p>Open <strong>layout.js</strong> file. In case of typescript it&#39;ll be <strong>layout.tsx</strong> and in case of pages router it’ll be inside _app.js file.</p><p><strong>Method 1:</strong> Using <strong>metadata</strong> inside layout.js.</p><blockquote>Note- line 5 to 8 is only addition to make inside layout.js.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf2f0c126c0915380525773345a3e714/href">https://medium.com/media/bf2f0c126c0915380525773345a3e714/href</a></iframe><p><strong>Method 2:</strong> Using <strong>link</strong> given by next.js <strong>head</strong>.</p><blockquote>Note- line 11 is the only addition to make inside layout.js.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afc45cd4207a28e24fae7c016534fc77/href">https://medium.com/media/afc45cd4207a28e24fae7c016534fc77/href</a></iframe><p>If above methods work for you, do consider following. If anything goes wrong with above methods please respond.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=710635ff839c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Icons for react/nextjs: React-icons-4.12.0 Update]]></title>
            <link>https://medium.com/@morerahul620/enhanced-react-icons-unveiling-the-latest-4-12-0-update-7ff7422d499b?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ff7422d499b</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-icon]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[icons]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 05:25:07 GMT</pubDate>
            <atom:updated>2024-01-20T18:48:10.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yY-SNI6oGpBQMhY0HRVLnA.png" /><figcaption><a href="https://react-icons.github.io/react-icons/">https://react-icons.github.io/react-icons/</a></figcaption></figure><p>Icons are very important in modern web development, providing great visual and enhancing user experience. In the React ecosystem, React-Icons stands out as a go-to library for seamlessly integrating icons into applications. The latest version, React-Icons 4.12.0, introduces enhancements and features that make icon integration even more straightforward and versatile.</p><h4>Whats New In 4.12.0</h4><p>React-Icons 4.12.0, updated in November 23 , is a robust library that simplifies icons into React applications. It supports various icon libraries, including <strong>Font Awesome</strong>, <strong>Material UI</strong>, <strong>Bootstrap icons</strong>, and more.</p><h4>Key Features of React-Icons:</h4><ol><li><strong>Simplicity in Integration :</strong> Developers can import the desired icon components and include them in JSX code effortlessly.</li><li><strong>SVG Icon Support :</strong> React-Icons works with SVG icons, ensuring compatibility with all major browsers. This approach allows developers to serve only the necessary icons, optimising performance and making it easier to manage icon usage in projects.</li><li><strong>Wide Range of Icons :</strong> The library boasts an extensive collection of icons, including popular packs like Font Awesome, Material Design, and Ionicons.</li></ol><h4>Setting Up React-Icons In a Nextjs or Reactjs project :</h4><p>To incorporate React-Icons into your project, use the following commands:</p><p><strong>Step 1 : Installation</strong></p><blockquote><em>npm install react-icons — save</em></blockquote><p><strong>Step 2: Picking Your Icon</strong></p><p>Go to this website — <a href="https://react-icons.github.io/react-icons/"><strong>https://react-icons.github.io/react-icons/</strong></a></p><p>Click on any icon set, for example “<strong>Bootstrap Icons</strong>”</p><p>Click on icon (The icon you want to use in your project), for example “<strong>bs/Bs0Circle</strong>”</p><p>You will see something like bellow image open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uj-ublSJG3U4dkF2mba2Zw.png" /></figure><p>Copy <strong>&lt;Bs0Circle/&gt; , </strong>this is an icon component.</p><p><strong>Step 3 : Importing the icon in reactjs</strong></p><p>Copy import statement of the icon (1st line in the image).</p><p><strong>import { Bs0Circle } from &quot;react-icons/bs&quot;;</strong></p><h4><strong>We are almost done</strong></h4><p>Once installed, import the desired icons and integrate them into your React components. It should look something like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/feb969ef8e56da465f3a0795252c3636/href">https://medium.com/media/feb969ef8e56da465f3a0795252c3636/href</a></iframe><h4><strong>Conclusion</strong></h4><p>React-Icons 4.12.0 emerges as a powerful tool for React developers seeking an efficient and versatile solution for integrating icons. Its ease of use, support for multiple icon sets, and continuous updates from the community make it a valuable asset in the React ecosystem.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ff7422d499b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add a Video Player in Your Next.js Project Using React-Player]]></title>
            <link>https://medium.com/@morerahul620/how-to-add-a-video-player-in-your-next-js-project-using-react-player-8aab643217ea?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aab643217ea</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-player]]></category>
            <category><![CDATA[video-player]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Sun, 05 Nov 2023 13:01:58 GMT</pubDate>
            <atom:updated>2024-01-20T18:47:20.309Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bUPmlZk8oiNwp-K9DmCo4Q.png" /><figcaption><a href="https://www.npmjs.com/package/react-player#standalone-player">https://www.npmjs.com/package/react-player#standalone-player</a></figcaption></figure><p>Videos are an integral part of modern web content. Whether you’re sharing educational tutorials, entertainment clips, or product demonstrations, the ability to seamlessly integrate a video player into your Next.js application is crucial. In this comprehensive guide, we’ll explore how to add a video player to your Next.js project.</p><h3>Why Use react-player in Next.js?</h3><p>react player offers a seamless solution for integrating video playback into your Next.js project. It&#39;s a user-friendly library that eliminates the need to build complex custom video players from scratch. What makes it stand out are its wide format support, responsiveness to different screen sizes, and the ability to adapt to videos from various sources, including YouTube, Vimeo, and self-hosted files.</p><h3>Let’s set it up</h3><p><strong>Step 1</strong> : install “react-player” in next.js project.</p><blockquote><em>npm i react-player</em></blockquote><p><strong>Step 2 :</strong> Follow bellow folder structure for better understanding.</p><p>a) Add your <strong>video</strong> (video you want to show on web page) into <strong>public</strong> folder</p><p>b) create a component file “<strong>VideoPlayer.jsx</strong>” inside components folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*dVDux5mORLsotFSlpBECTQ.png" /></figure><p><strong>Step 3 : </strong>In page.js import VideoPlayer component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd60044053000b620f52de572071e26b/href">https://medium.com/media/dd60044053000b620f52de572071e26b/href</a></iframe><p>Step 4: In VideoPlayer component import <strong>ReactPlayer</strong> from react-player.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e03b1a6181cf1258a00147c91271cbe5/href">https://medium.com/media/e03b1a6181cf1258a00147c91271cbe5/href</a></iframe><p><strong>Step 5: </strong>run the app</p><blockquote><em>npm run dev</em></blockquote><p>You can checkout the official documentation for more options and customization which react-player provides. To test the options available with react-player ,check this link — <a href="https://cookpete.com/react-player/">https://cookpete.com/react-player/</a></p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aab643217ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeScript for Mac: A Installation Guide for M1 &M2]]></title>
            <link>https://medium.com/@morerahul620/typescript-for-mac-a-installation-guide-for-m1-m2-e7a2a531d2a6?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7a2a531d2a6</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 05:44:28 GMT</pubDate>
            <atom:updated>2024-07-28T06:41:19.939Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DH38dAaZcxdGrHfBCJvZ2A.jpeg" /><figcaption><a href="https://www.typescriptlang.org/">https://www.typescriptlang.org/</a></figcaption></figure><p>TypeScript is a powerful language that enhances JavaScript by adding static typing. In this comprehensive guide, I will walk you through the installation and setup process for TypeScript on your M1 or M2 Mac.</p><h4>Why Choose TypeScript over javascript?</h4><ol><li><strong>Static Typing:</strong> TypeScript catches type errors at compile time.</li><li><strong>Improved Code Quality:</strong> Type annotations enhance code readability.</li><li><strong>Code Safety:</strong> TypeScript reduces runtime errors, making code safer and more predictable.</li><li><strong>Gradual Adoption:</strong> You can introduce TypeScript incrementally into existing projects.</li><li><strong>Community and Ecosystem:</strong> TypeScript has a strong community and is widely adopted, with support for popular libraries and frameworks.</li></ol><h3>Prerequisites</h3><p>You should have Node.js &amp; Npm installed in your mac.</p><h4>To install Typescript globally in mac</h4><p>Open terminal in mac — (you need to put mac’s password after entering sudo command in the terminal)</p><blockquote><em>sudo npm i -g typescript</em></blockquote><p>To check if TypeScript is installed successfully, run:</p><blockquote><em>tsc -v</em></blockquote><p>Create a file with name and extension “.ts”, open it in code editor.</p><p>Write your first code, write command “<strong>tsc filename.ts</strong>” in code editor terminal, it will generate a javascript file(check below screenshot).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rkcQC4SxE_KYGszEeVMgg.png" /></figure><p>To run the code file</p><blockquote><em>node filename.js</em></blockquote><h4>Optional things to do</h4><p>Create a “tsconfig.json” — tsconfig.json is a configuration file used in TypeScript projects to specify compiler options and settings. It is vital for controlling how the TypeScript compiler processes your code, including specifying the target JavaScript version, module system, type checking strictness, output directory, and more. By defining a “tsconfig.json” file in your project&#39;s root directory, you can effectively tailor TypeScript&#39;s behavior to your project&#39;s needs and streamline the compilation process.</p><blockquote><em>tsc - - init</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83a7912de8a61c7c99f4fb45544e1439/href">https://medium.com/media/83a7912de8a61c7c99f4fb45544e1439/href</a></iframe><p>With TypeScript and your M1/M2 Mac, you’re well-equipped to tackle any development challenge that comes your way.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7a2a531d2a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vite vs Create React App: Vite + React Project Setup]]></title>
            <link>https://medium.com/@morerahul620/vite-vs-create-react-app-vite-react-project-setup-58d6eeefd179?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/58d6eeefd179</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[vites]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 16:29:04 GMT</pubDate>
            <atom:updated>2024-01-20T18:45:53.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*lkjF5RLlTdyfie_j.png" /><figcaption><a href="https://vitejs.dev/guide/">https://vitejs.dev/guide/</a></figcaption></figure><p><strong>What is CRA? -</strong>CRA stands for “Create React App.” It is an open-source tool and a set of pre-configured templates and scripts that simplify the process of setting up and building React applications. Create React App is developed and maintained by the React team at Facebook.</p><p><strong>What is Vite?</strong> — Vite is a build tool and development server for modern web development, primarily focused on JavaScript and TypeScript frameworks like Vue, React, and Svelte. It was created by Evan You, the same individual who created the Vue.js framework. Vite is designed to provide a highly efficient and fast development experience.</p><h4>Why Vite Is Better Than CRA ?</h4><ol><li><strong>Faster Development</strong>: Vite has a significantly faster development server , while CRA is slower.</li><li><strong>Efficient Builds</strong>: Vite produces smaller and faster production builds.</li><li><strong>Flexible Configuration:</strong> Vite offers a more customizable and intuitive configuration system.</li><li><strong>ESM Support:</strong> Vite uses native ES modules for better modern browser compatibility.</li><li><strong>Simplified Migration</strong>: Upgrading within Vite versions is usually smoother than CRA version migrations.</li><li><strong>Active Development:</strong> Vite is actively developed with a focus on improving developer experience and build processes.</li></ol><h3><strong>React js Project Setup With Vite-</strong></h3><ol><li><strong>Step1: </strong>npm create vite@latest</li></ol><p>After entring above command in terminal you will have space to type your react.js ‘project name’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*DoOVjyZII_V9JndyCOkpGQ.png" /></figure><p>2. <strong>Step 2 : </strong>After entering project name and hiting enter, You will see bellow options in the terminal, here with the help of down arrow select ‘React’ and hit enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAJ-xRTdHhwBeK32x_PAXA.png" /></figure><p>3. <strong>Step 3:</strong> Select Typescript or Javascript from given options as per your project requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6f_fwRoFSwUsLow1v7-iQ.png" /></figure><p>Your React app is almost ready now, use 3 commands given bellow to get your react app up and running.</p><p>a) cd react-app</p><p>b) npm install</p><p>c) npm run dev</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQ6L-bsRB98knLS9o1Yk8A.png" /></figure><p>This is how your app will look like.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58d6eeefd179" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React-Hot-Toast setup in Next.js]]></title>
            <link>https://medium.com/@morerahul620/react-hot-toast-setup-in-next-js-bbf2b5d91c63?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbf2b5d91c63</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[toast]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Mon, 16 Oct 2023 12:30:14 GMT</pubDate>
            <atom:updated>2024-08-08T07:34:41.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMW1_QDDPCJ5C420Be0Sfw.jpeg" /><figcaption><a href="https://react-hot-toast.com/docs">https://react-hot-toast.com/docs</a></figcaption></figure><p>Toast notifications are those little messages that briefly appear on a website or app to let you know something happened. Whether it’s a success message, an error alert. In this blog, i’ll show you how to add these toast notifications to your Next.js application using the react-hot-toast library.</p><h3>Why Toast Notifications?</h3><p>Think of toast notifications as a polite tap on the shoulder, delivering information without causing any disruptions. They’re a user-friendly way to share updates and feedback.</p><p>“Toast notifications are a common feature used by many big websites and applications. For instance, Gmail employs toast notifications to confirm the successful sending of emails. Twitter uses these notifications for new tweets, mentions, and direct messages.Many more brands like Facebook, GitHub, Slack, WhatsApp etc use toast notifications for delivering information”</p><h3>Let’s Setup Our Next.js app for ‘react-hot-toast’</h3><p>We are going to see, when user clicks on a button, a toast of ‘you did it’ will appear on the screen.</p><h3>Step 1: Installing react-hot-toast</h3><blockquote><em>npm install react-hot-toast</em></blockquote><h3>Step 2: Add toaster component above children in layout.js for app router.</h3><blockquote>Note — added line 17 into the default layout.js file.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84b32ef301f9797fe6a4bf894623d687/href">https://medium.com/media/84b32ef301f9797fe6a4bf894623d687/href</a></iframe><p><strong>Toster position</strong> — Toast position determines where on the screen toast notifications should appear. You can choose positions like top-right for a balanced view or bottom-left for less intrusiveness. The choice depends on your design and the level of attention you want to draw to notifications.</p><h3>Step 3: Displaying Toast Notifications</h3><blockquote>Note — import <strong>toast.js </strong>(file where you are using toast, don’t get confused with the name)<strong> </strong>into our page.js (page.js is in the same folder with layout.js)</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62439ddb6d2fa7dd2c0c8ef9d3b50f19/href">https://medium.com/media/62439ddb6d2fa7dd2c0c8ef9d3b50f19/href</a></iframe><blockquote>Note — You can also customise and use different toast styles, refer official docs for that. <a href="https://react-hot-toast.com/docs">https://react-hot-toast.com/docs</a></blockquote><p>Adding toast notifications to your Next.js app is an easy way to communicate with users without interrupting their experience. With react-hot-toast, you can make your website or app more user-friendly and interactive. Happy coding!</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbf2b5d91c63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a Custom Hook in React.js/Next.js]]></title>
            <link>https://medium.com/@morerahul620/creating-a-custom-hook-in-react-js-next-js-986ed99ba18?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/986ed99ba18</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[hooks]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Fri, 29 Sep 2023 12:41:22 GMT</pubDate>
            <atom:updated>2024-01-20T18:44:29.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZQrVQmWD-iPIkGBNc-Y4A.png" /></figure><p>In this blog post, we will explore how to create a <em>custom counter</em> hook in React.js to demonstrate how hooks can be used to encapsulate and reuse logic.</p><h3>What is a Custom Hook?</h3><p>Custom hooks are JavaScript functions that allow you to reuse stateful logic across different components in your React application.</p><h4><strong>Steps to create a Custom Hook</strong></h4><ol><li>Choose a Descriptive Name: Name your custom hook with the word “use” to follow the hook naming convention (e.g., useCounter).</li><li>Create a Function: Define a JavaScript function that encapsulates the reusable logic you want to share.</li><li>Import Necessary Hooks: Inside your custom hook function, import any built-in hooks you need, such as useState, useEffect, or useContext.</li><li>Declare State and Functions: Declare state variables and functions within your custom hook to manage and interact with the logic you’re encapsulating.</li><li>Return Values: Return the values or functions you want to expose from your custom hook as an object or array.</li><li>Use the Custom Hook: Import and use your custom hook in React components as needed. Destructure the returned values and functions for use in your component.</li><li>Reuse: Reuse it across different components and projects to promote code reusability.</li></ol><h3>Creating a Custom Counter Hook</h3><p>Let’s start by creating a simple custom counter hook that manages the state of a counter and provides functions to increment and decrement it. Here’s how you can create this custom hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaf105e890b6f87b315905ec779936b0/href">https://medium.com/media/eaf105e890b6f87b315905ec779936b0/href</a></iframe><p>In this code, we import the useState hook from React, which allows us to manage state within our custom hook. The useCounter function initializes the state with an initial value (defaulting to 0) and provides two functions, increment and decrement, to modify the counter&#39;s value. Finally, it returns an object containing the current count and the two functions.(You can replace your function and logic with the useCounter function)</p><h3>Using the Custom Counter Hook</h3><p>Now that we have our custom counter hook, let’s see how to use it in a React component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaef0d2325629a89bcfeeef9812b745d/href">https://medium.com/media/eaef0d2325629a89bcfeeef9812b745d/href</a></iframe><p>In this component, we import and use our custom hook, useCounter. We destructure the returned object to access the count, increment, and decrement functions, which we then use in our JSX to display the current count and provide buttons to increment and decrement it.</p><p>By using this custom hook, we encapsulate the counter logic and make it reusable across different components in our application. This separation of concerns makes our code more modular and easier to maintain.</p><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=986ed99ba18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why To Choose Nextjs Over Reactjs?]]></title>
            <link>https://medium.com/@morerahul620/why-to-choose-nextjs-over-reactjs-e934de95ccdf?source=rss-ab0b7572a279------2</link>
            <guid isPermaLink="false">https://medium.com/p/e934de95ccdf</guid>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[rahul more]]></dc:creator>
            <pubDate>Fri, 22 Sep 2023 00:52:00 GMT</pubDate>
            <atom:updated>2024-01-20T18:43:13.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0E33YfgTgBDZ2YcD53zg6Q.png" /></figure><p>When it comes to web development, picking the right framework can make a huge difference. React.js has been a top choice for a long time, but now there’s a new player in town that’s gaining attention — Next.js. In this blog post, we’ll explain why developers are switching from React.js to Next.js by breaking down how they work.</p><h3><strong>React.js:</strong></h3><p>React.js operates by delivering a single, comprehensive bundle of JavaScript code to the user’s web browser, encompassing the instructions for rendering the web page’s appearance and functionality. The browser, in turn, interprets and executes this JavaScript code to render the page accurately. React.js is inherently rooted in JavaScript, even when employing JSX for defining the page’s visual structure; the core functionality relies on JavaScript. Consequently, server-side optimizations have limitations in enhancing application speed, primarily improving initial responses but falling short compared to the rapid file delivery capabilities of Content Delivery Networks (CDNs).</p><h3>Next.js: Advantages</h3><p>Now, let’s talk about Next.js.</p><p><em>1)Server-Side Rendering (SSR): A Game-Changer</em></p><p>One of Next.js’s standout features is server-side rendering (SSR). Unlike React, which does rendering in the user’s browser, Next.js generates the web page on the server and sends it to the user’s browser as ready-to-display HTML. This matters because browsers are really good at showing HTML quickly, much better than running JavaScript.</p><p>This difference becomes crucial in larger or more complex applications.</p><p><em>2)The CDN Advantage</em></p><p>Next.js truly comes into its own with CDNs. CDNs are super-fast at delivering static content because they’re designed for that purpose. They’re also spread all over the world, so users get files from the closest server, reducing delays.</p><p>With Next.js, you can store pre-rendered pages on CDNs. This means the server doesn’t have to do all the work. Instead, the CDN serves the ready-made pages directly to users, making your website lightning-fast.</p><p><em>3)SEO-Friendly</em></p><p>Next.js is designed with search engine optimization (SEO) in mind. Since it generates HTML on the server, search engines can easily crawl and index your content, improving your site’s visibility in search results.</p><p><em>4)Automatic Code Splitting</em></p><p>Next.js provides automatic code splitting out of the box. This means that only the JavaScript code necessary for the current page is loaded, reducing initial load times and improving performance.</p><p><em>5)Client-Side Routing</em></p><p>Next.js simplifies client-side routing with a built-in routing system. You can create dynamic routes effortlessly, and the framework handles route-based code splitting, making navigation smooth and efficient.</p><p><em>6)API Routes</em></p><p>Next.js allows you to create API routes within your application. These routes can serve as backends for your frontend, making it easy to handle server-side logic and data processing.</p><blockquote><em>Summery — In a nutshell, Next.js is the ultimate web wizard — faster, smarter, and loved by developers worldwide. It’s the secret sauce behind speedy sites and top-notch SEO. Whether you’re a coding pro or just getting started, Next.js has your back.</em></blockquote><p>Follow me here —</p><p>Twitter- <a href="https://twitter.com/rahulmoreweb3">https://twitter.com/rahulmoreweb3</a></p><p>Linkedin- <a href="https://www.linkedin.com/in/rahul-more-540b8b156/">https://www.linkedin.com/in/rahul-more-540b8b156/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e934de95ccdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>