<?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: Moha Saket</title>
    <description>The latest articles on DEV Community by Moha Saket (@mohasaket).</description>
    <link>https://dev.to/mohasaket</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%2F773530%2F649da4db-a06d-46c6-a82a-410b07fb2f14.jpg</url>
      <title>DEV Community: Moha Saket</title>
      <link>https://dev.to/mohasaket</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohasaket"/>
    <language>en</language>
    <item>
      <title>Updating Existing State in React</title>
      <dc:creator>Moha Saket</dc:creator>
      <pubDate>Sun, 19 Dec 2021 18:16:34 +0000</pubDate>
      <link>https://dev.to/mohasaket/updating-existing-state-in-react-1394</link>
      <guid>https://dev.to/mohasaket/updating-existing-state-in-react-1394</guid>
      <description>&lt;p&gt;how we update state based off of existing values in the state.&lt;br&gt;
So I have a score value in the state.&lt;br&gt;
Imagine this is a game and when we click this button single kill I want it to add one to the score value.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w2dnOmiz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssh3g22e1c88s2uufvkz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w2dnOmiz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssh3g22e1c88s2uufvkz.png" alt="Image description" width="800" height="641"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;it's best if you are updating existing values in the state to use the callback form .So this magic callback form.&lt;br&gt;
What's that look like this upset state and we pass in a callback function instead of passing in an object and instead of that callback function we make the current state a parameter and it should return an object that represents the new state.&lt;br&gt;
So &lt;a href="https://github.com/mohasaket/react-state-pattern"&gt;here's&lt;/a&gt; an example we can set state will pass in a function and we need to add this parameter current state or you can just call it state.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>TO DO LIST WITH ANGULAR</title>
      <dc:creator>Moha Saket</dc:creator>
      <pubDate>Mon, 13 Dec 2021 07:31:10 +0000</pubDate>
      <link>https://dev.to/mohasaket/to-do-list-with-angular-2d4j</link>
      <guid>https://dev.to/mohasaket/to-do-list-with-angular-2d4j</guid>
      <description>&lt;p&gt;At this point, we are ready to start creating our to-do list application using Angular. The finished application will display a list of to-do items and includes editing, deleting, and adding features. In this article you will get to know your application structure, and work up to displaying a basic list of to-do items.&lt;br&gt;
check this link&lt;br&gt;
&lt;a href="https://github.com/mohasaket/TodoList/tree/master/src/app"&gt;to do list&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to create a Dice Rolling App using ReactJS</title>
      <dc:creator>Moha Saket</dc:creator>
      <pubDate>Mon, 13 Dec 2021 07:12:05 +0000</pubDate>
      <link>https://dev.to/mohasaket/rolling-dice-app-with-react-state-and-props-2i29</link>
      <guid>https://dev.to/mohasaket/rolling-dice-app-with-react-state-and-props-2i29</guid>
      <description>&lt;p&gt;There are two components Die and RollDice. The Die component is responsible to show one individual Dice. It is a stateless component. It uses the font-awesome library to show the standard dots on the upper face of the dice. RollDice component contains all the logic to generates random numbers to show on the upper face of the dice, roll each dice upon click on the roll button. There are two states involve in the RollDice component named ‘die1’ and ‘die2’. Each one has initialized with the value one i.e. each die shows one(one dot) when the application first starts. &lt;/p&gt;

&lt;p&gt;Now, we set the click event handler to the roll dice button and when anyone clicks on the button we change the state of both die1 and die2 to some random number using setState from one to six (we use a number as a word since font-awesome library deals with word number to show the exact number of dots). We also make sure when the dice is rolling user can’t click on the button again. For this purpose we use a state ‘rolling’ initially set to false and when the dice are rolling set rolling to true and start a timer of one second. After one second again set rolling state to false’. Disable the button when a rolling state is set to true.&lt;br&gt;
This is a rough overview of the application. go to this &lt;a href="https://github.com/mohasaket/DICE-ROLLER"&gt;link&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1EO3zRIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9dekxvitrwo6zab2yete.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1EO3zRIp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9dekxvitrwo6zab2yete.jpg" alt="Image description" width="225" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
