<?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: priyanshu740</title>
    <description>The latest articles on Forem by priyanshu740 (@priyanshu740).</description>
    <link>https://forem.com/priyanshu740</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%2F685458%2F015f47d6-1f79-4c01-9520-bcedd7351da0.png</url>
      <title>Forem: priyanshu740</title>
      <link>https://forem.com/priyanshu740</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/priyanshu740"/>
    <language>en</language>
    <item>
      <title>Portfolio app with nextjs, reactjs and typescript.</title>
      <dc:creator>priyanshu740</dc:creator>
      <pubDate>Thu, 29 Feb 2024 19:28:18 +0000</pubDate>
      <link>https://forem.com/priyanshu740/portfolio-app-with-nextjs-reactjs-and-typescript-4ham</link>
      <guid>https://forem.com/priyanshu740/portfolio-app-with-nextjs-reactjs-and-typescript-4ham</guid>
      <description>&lt;p&gt;In this guide, we'll walk through the process of creating a portfolio app using Next.js, React.js, and TypeScript, from setting up the prerequisites to the basic steps to get you started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Pre-requisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of JavaScript and reactjs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure you have Node.js installed on your machine, You can download and install Node.js from nodejs.org.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Project setup and creting a nextjs enviourment&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Next.js App:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open your terminal or command prompt and run the following command to create a new Next.js app:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest my-portfolio --typescript --eslint&lt;br&gt;
cd my-portfolio&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once the project is created, navigate to your project directory:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To enable TypeScript, install the required dependencies:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm install --save-dev typescript @types/react @types/node&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure you have node version above 18.12.0 to run the next app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Run the development server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;3. System design *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We are going to divide this application in some steps from system design to making different components and using MVC approach.&lt;/p&gt;

&lt;p&gt;-&amp;gt; System design&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After the setup of nextjs project, we are going to install require dependancies for the project we are going to setup tailwind css in the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm install -D tailwindcss postcss autoprefixer&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now configure tailwind.config.js file and replace it with this code&lt;br&gt;
`/** @type {import('tailwindcss').Config} &lt;em&gt;/&lt;br&gt;
module.exports = {&lt;br&gt;
content: [&lt;br&gt;
"./app/&lt;/em&gt;&lt;em&gt;/&lt;/em&gt;.{js,ts,jsx,tsx,mdx}",&lt;br&gt;
"./pages/&lt;strong&gt;/*.{js,ts,jsx,tsx,mdx}",&lt;br&gt;
"./components/&lt;/strong&gt;/*.{js,ts,jsx,tsx,mdx}",&lt;/p&gt;

&lt;p&gt;// Or if using &lt;code&gt;src&lt;/code&gt; directory:&lt;br&gt;
"./src/*&lt;em&gt;/&lt;/em&gt;.{js,ts,jsx,tsx,mdx}",&lt;br&gt;
],&lt;br&gt;
theme: {&lt;br&gt;
extend: {},&lt;br&gt;
},&lt;br&gt;
plugins: [],&lt;br&gt;
}`&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Typescript files are compile to javascript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Creating pages for application&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First we will start by creating a navigation bar for the application, &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For that go to components and create a new file called Navbar.tsx&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Further, we will create a UI for it, and add list and navigation to different pages through it &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ja0qjr5a87hev9xz8xh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ja0qjr5a87hev9xz8xh.png" alt="Image description" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can customize the navbar according to your need, like change the styles, removing or adding some lists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned for next blog on next week!&lt;/p&gt;

&lt;p&gt;Code : &lt;a href="https://www.buymeacoffee.com/Priyanshu7401"&gt;https://www.buymeacoffee.com/Priyanshu7401&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to start ReactJs for begginers</title>
      <dc:creator>priyanshu740</dc:creator>
      <pubDate>Sun, 14 Nov 2021 05:59:01 +0000</pubDate>
      <link>https://forem.com/priyanshu740/how-to-start-reactjs-for-begginers-2c5n</link>
      <guid>https://forem.com/priyanshu740/how-to-start-reactjs-for-begginers-2c5n</guid>
      <description>&lt;p&gt;hello, dev community i am gonna tell you how to start learning Reactjs . this post is only for beginners and for how to start learning react , we will also gonna discuss about Pre-requisites and topics and fundamental to learn before react&lt;/p&gt;

&lt;h1&gt;
  
  
  Pre-requisites for learning react
&lt;/h1&gt;

&lt;p&gt;we assume that you have clear some below fundaments of this topics before learning react&lt;/p&gt;

&lt;p&gt;1) Basics of HTML&lt;/p&gt;

&lt;p&gt;2) Basics of CSS&lt;/p&gt;

&lt;p&gt;3) Basics of JavaScript(Variables,DOMmanuplation,datatypes,events etc)&lt;/p&gt;

&lt;h1&gt;
  
  
  Installing ReactJs
&lt;/h1&gt;

&lt;p&gt;-&amp;gt; for installing reactjs in windows click &lt;a href="https://www.liquidweb.com/kb/install-react-js-windows/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-&amp;gt; for installing reactjs in MacOs click &lt;a href="https://www.zeolearn.com/magazine/setup-react-mac" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Learning react
&lt;/h1&gt;

&lt;p&gt;Fundamentals: All the above things we have discussed were the prerequisite of ReactJS. Now once you learn all the above things it’s time to jump into React. Understand the basic concept of React first&lt;/p&gt;

&lt;p&gt;the first thing you need to learn about react is state and props and how to use them &lt;/p&gt;

&lt;p&gt;State: Basically ‘state’ holds synchronous variables. If you change the value of a state variable then the change is reflected immediately in all the places that particular variable is used.&lt;/p&gt;

&lt;p&gt;Props: are just like arguments passed in a function or method. In React props (arguments) are passed into an HTML tag as input arguments.&lt;/p&gt;

&lt;p&gt;after learning state and props you can learn the diffrence between functional component and class component&lt;br&gt;
both of the approchs are good for reactJS but i will suggests that if you are newbie in react then first learn the function component as you are familier with the es6 fuinctions and otheer approches of the javascript &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F4u5gudleypctvfgcurde.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4u5gudleypctvfgcurde.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  after that you can create simple projects like
&lt;/h3&gt;

&lt;p&gt;simple to-do application &lt;br&gt;
&lt;a href="https://github.com/kabirbaidhya/react-todo-app" rel="noopener noreferrer"&gt;https://github.com/kabirbaidhya/react-todo-app&lt;/a&gt;&lt;br&gt;
calculator&lt;br&gt;
&lt;a href="https://github.com/ahfarmer/calculator" rel="noopener noreferrer"&gt;https://github.com/ahfarmer/calculator&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is state and adding state to the application
&lt;/h3&gt;

&lt;h4&gt;
  
  
  The state
&lt;/h4&gt;

&lt;p&gt;Unlike the props, the state data is local and specific to the component that owns it. It is not accessible to any other components unless the owner component chooses to pass it down as props to its child component(s).&lt;/p&gt;

&lt;p&gt;Even while the child component receives the data in its props, it wouldn’t know where exactly the data comes from. Maybe it was inputted or comes from the props.&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding state to the component
&lt;/h4&gt;

&lt;p&gt;Now, once the component receives this input data, we need to pass it to a central location where we can manage it and display in the browser view.&lt;/p&gt;

&lt;p&gt;This allows other components to have access to this data.&lt;/p&gt;

&lt;p&gt;For instance, the TodosList component will be accessing the data and display its todos items. Also, the TodoItem component (which holds the checkbox and delete button) will be accessing the data to update the checkbox, update edited items and also remove items from the state.&lt;/p&gt;

&lt;p&gt;To add a state in a class component, we simply create a state object with key-value pair. The value can be of any data type. In the code below, the value is an array.&lt;/p&gt;

&lt;h4&gt;
  
  
  state = {
&lt;/h4&gt;

&lt;h4&gt;
  
  
  todos: [],
&lt;/h4&gt;

&lt;h4&gt;
  
  
  }
&lt;/h4&gt;

&lt;h3&gt;
  
  
  The React Developer Tools
&lt;/h3&gt;

&lt;p&gt;If you want to inspect and debug your application, check your components tree or see how React works in real-time, you will need this tool. It is available as a browser extension for Chrome and Firefox.&lt;/p&gt;

&lt;p&gt;Let’s go ahead and install it.&lt;/p&gt;

&lt;p&gt;Head over to the extension page for your browser of choice (Chrome here and Firefox here) and install it.&lt;/p&gt;

&lt;p&gt;Once you install it, you are done. It doesn’t require any other setup.&lt;/p&gt;

&lt;h4&gt;
  
  
  =&amp;gt; after learning some basic concepts like installing it how to use components how to debug the application etc. you will learn react lifecycle , event handling , how to use external library's in another part
&lt;/h4&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
