<?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: Poornima Gowda</title>
    <description>The latest articles on DEV Community by Poornima Gowda (@poornima545).</description>
    <link>https://dev.to/poornima545</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%2F1718653%2F3e00112f-fcc7-449f-8cd3-c64c866f9695.png</url>
      <title>DEV Community: Poornima Gowda</title>
      <link>https://dev.to/poornima545</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/poornima545"/>
    <language>en</language>
    <item>
      <title>Getting started with react</title>
      <dc:creator>Poornima Gowda</dc:creator>
      <pubDate>Tue, 03 Sep 2024 13:18:39 +0000</pubDate>
      <link>https://dev.to/poornima545/getting-started-with-react-2599</link>
      <guid>https://dev.to/poornima545/getting-started-with-react-2599</guid>
      <description>&lt;p&gt;Firstly, React is a popular JavaScript library for building UI, especially for single-page applications. It allows developers to create reusable components and efficiently manage the state of their applications. In this blog, I'll go through the process of setting up a React project and many more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Before getting into the react or creating react project, you must have to install the following tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Node.js:&lt;/strong&gt; you can download the latest version of Node.js from the official website:&lt;a href="https://dev.tourl"&gt; https://nodejs.org/en&lt;/a&gt;.&lt;br&gt;
&lt;strong&gt;2. Code Editor:&lt;/strong&gt; You can use any editor that you comfortable with, I highly recommended to use VSCode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to create a project&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open command prompt or your terminal.&lt;/li&gt;
&lt;li&gt;Run the following cmd
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Replace my-app with the name of your project.
npx create-react-app my-app

//navigate to your project directory
cd my-app 

//this cmd helps us to run our script
npm start 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Folder Structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-app/
├── node_modules/
├── public/
│   ├── index.html
│   └── manifest.json
├── src/
│   ├── components/
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   └── reportWebVitals.js
├── .gitignore
├── package-lock.json
├── package.json
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1. node_modules:&lt;/strong&gt; A directory where all the dependencies like libraries and packages required by your project are stored.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. src:&lt;/strong&gt; The source folder that contains all your React application code. This is where you write the components, styles, and logic for your React application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. package.json:&lt;/strong&gt; A JSON file that contains metadata about your project and the dependencies it requires. It manages the project's dependencies, scripts, version, and other things.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Promises In Javascript</title>
      <dc:creator>Poornima Gowda</dc:creator>
      <pubDate>Tue, 20 Aug 2024 06:01:33 +0000</pubDate>
      <link>https://dev.to/poornima545/promises-in-javascript-3ki5</link>
      <guid>https://dev.to/poornima545/promises-in-javascript-3ki5</guid>
      <description>&lt;p&gt;In javascript, promises are one of the techniques to deal with asynchronous operations that introduced in the ES6. If you are working on like fetching data or  waiting for timer using setTimeout method, much easier to manage and more readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Promises?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A promise is an object that represents the eventual completion/ failure of an asynchronous operation and its resulting value. it can be in one of three states.&lt;br&gt;
   1.Pending: The initial state, Operation is ongoing, neither &lt;br&gt;
     fulfilled nor rejected.&lt;br&gt;
   2.Fulfilled: The operation completed successfully.&lt;br&gt;
   3.Rejected: The operation failed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const myPromise = new Promise((resolve, reject) =&amp;gt; {})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Firstly, we have to use a constructor to create a Promise object by using &lt;strong&gt;new Promise()&lt;/strong&gt;,This is called &lt;strong&gt;executor&lt;/strong&gt;. It takes a single function with two parameters: &lt;strong&gt;resolve()&lt;/strong&gt; and &lt;strong&gt;reject()&lt;/strong&gt;.&lt;br&gt;
And resolve is executed when the operation is successful. Otherwise, reject is executed when operation fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consuming process:&lt;/strong&gt;&lt;br&gt;
So, we can't access promises directly, to handle the promise result we have to use .&lt;strong&gt;then()&lt;/strong&gt;  &amp;amp; .&lt;strong&gt;catch()&lt;/strong&gt; method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myPromise.then(() =&amp;gt; {
    //console here..
}).catch(() =&amp;gt;{
   //error
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;.then() -&lt;/strong&gt; It is used to handle the result of a Promise once it has been resolved (successfully completed) or rejected (failed). &lt;br&gt;
&lt;strong&gt;.catch() -&lt;/strong&gt; This method is invoked when promise is rejected or some error has occurred in execution. This method is used for handling errors.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>frontendchallenge</category>
    </item>
  </channel>
</rss>
