<?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: AnthonyH00</title>
    <description>The latest articles on DEV Community by AnthonyH00 (@anqirek).</description>
    <link>https://dev.to/anqirek</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%2F743511%2F3d0e9c95-e8e1-471f-98a0-7160f56780e6.png</url>
      <title>DEV Community: AnthonyH00</title>
      <link>https://dev.to/anqirek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anqirek"/>
    <language>en</language>
    <item>
      <title>Fetching data with Nested Objects</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Thu, 28 Jul 2022 19:22:53 +0000</pubDate>
      <link>https://dev.to/anqirek/fetching-data-with-nested-objects-5ce2</link>
      <guid>https://dev.to/anqirek/fetching-data-with-nested-objects-5ce2</guid>
      <description>&lt;p&gt;So, I've decided to create this blog because I've seen several articles with people experiencing the same issue I dealt with. fetching data with nested objects.&lt;br&gt;
  For people new to programming, such as myself, I think we often find ourselves running into hundreds of problems a week as we learn new skills. The most frustrating part about this, at least for myself, is running into an issue you've once resolved. For me, that is this blog topic.&lt;br&gt;
  I first ran into this issue during my bootcamp course, but I was able to resolve it fairly quickly(maybe a few hours, up to a day). It was also from a public API. The next time I experienced this issue, the data was created from scratch, and when fetching the data, I would get a response that looks like the following:&lt;br&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%2F9w85gz90y2zy5gvwsr4s.png" 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%2F9w85gz90y2zy5gvwsr4s.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
  When trying to access the data, I often ran into a few recurrent errors. Here are the most frequent ones I've encountered:&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%2Fr5mpxcc9717igszg1j8q.png" 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%2Fr5mpxcc9717igszg1j8q.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server would try to identify the "id", and would fail to read it, despite console logging and confirming data being returned is correct.&lt;/li&gt;
&lt;/ul&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%2Fekdkxyzjlpzqoiop5xh4.png" 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%2Fekdkxyzjlpzqoiop5xh4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server cannot access the route. Assuming the route is setup correctly, this error occurs because the path to access the route,
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000/data/`${data.id}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;cannot access the id of the data. This would work if there was a numerical value that represents the value in the first image above. The path would look something like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000/data/0/`${data.id}`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What eventually worked for me, was using the Object.values and data.filter methods. Another important factor I discovered, was knowing how to Google(I'm still not good at it, getting better though). I didn't find a specific article or solution for this problem, I put pieces together from different articles, kept trying until I produced a result that allowed me to keep going. Heres what the code looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(()=&amp;gt;{
      fetch(itemURL)
      .then(res =&amp;gt; res.json())
      .then((allItems) =&amp;gt; Object.values(allItems).filter((value)=&amp;gt;{
        return setItems(value)
      }))

     },[])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although I was able to resolve the issue to an extent, I still am left with questions. How does the data return as nested objects? Is it due to the amount of data being fetched? How can we fetch promise data from nested objects, and access them? Thank you if you read this far. If you have any questions, answers, or input, feel free to reach out. I am always open to learn something new.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>User Authentication, Rails Backend</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Mon, 10 Jan 2022 10:15:19 +0000</pubDate>
      <link>https://dev.to/anqirek/user-authentication-rails-backend-2gnf</link>
      <guid>https://dev.to/anqirek/user-authentication-rails-backend-2gnf</guid>
      <description>&lt;p&gt;Ever wonder how that sign-in window, login screen, and/or authentication request is created? I definitely did. It would be more accurate to say, prior to my coding bootcamp, I attempted to learn coding on my own. Authentication was one of the topics, I found myself being really confused with. I didn't understand it, and couldn't find the exact information I was looking for. Armed with a little more knowledge (and practice), I hope this will help you better understand how to implement user Authentication, focusing on Rails backend.&lt;/p&gt;

&lt;p&gt;First, let's define Authentication. Whenever you attempt to login to a program or application, your credentials are checked against the server it was setup/monitored on. If the check passes, your account is authenticated and your account will login. Basically, it's confirming you are the account that you're logging into.&lt;br&gt;
 Now that we have defined Authentication. How can we setup code that implements it? There are several ways to do this. I prefer using sessions, so we'll implement this process now.&lt;br&gt;
 &lt;strong&gt;Step 1:&lt;/strong&gt; &lt;br&gt;
 First ensure a SessionController is setup. Plenty of ways to create a SessionController, but I use the terminal command,'rails g controller Sessions'. This will be used to check the account credentials being typed and the actions that follow. See this Ex:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UvYPAwaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvw1pvb3fqopfuv5euzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UvYPAwaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvw1pvb3fqopfuv5euzc.png" alt="Image description" width="880" height="181"&gt;&lt;/a&gt;&lt;br&gt;
using data from your database, along with the params hash and session ID, I setup a cookie in the session hash to handle the action for checking to see if the information typed matches the credentials in the database.&lt;br&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt; &lt;br&gt;
Once the controller has been set, you'll have to create the POST route which will submit the user inputted form on the frontend, to the route specified. See the following EX:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oKtH1pFT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tzhv0h2x0zlw3be21ql.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oKtH1pFT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tzhv0h2x0zlw3be21ql.png" alt="Image description" width="856" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;br&gt;
Ensure error checking is implemented. So when a user types an incorrect username and/or password combination, they'll receive a descriptive error.&lt;/p&gt;

&lt;p&gt;There are more steps to the Authentication process on the frontend (navigating to the route/site, entering credentials, etc) but I wanted to give an overview of the backend steps that I've used that works. Personally, finding this information had been difficult at times, as I was just learning the material. I hope this can be of some reference for all beginners. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>More Class Please...</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Mon, 10 Jan 2022 10:14:24 +0000</pubDate>
      <link>https://dev.to/anqirek/more-class-please-5c55</link>
      <guid>https://dev.to/anqirek/more-class-please-5c55</guid>
      <description>&lt;p&gt;Hello again! We're back, and here to talk about our favorite subject, class components. More specifically, the lifecycle hooks. As you may remember, I previously posted about the three main phases of class, Mounting, Updating, and Un-mounting. Within each phase, there are several processes called lifecycle methods (or &lt;em&gt;hooks&lt;/em&gt;) that help create the applications the user sees, and interact with. Well, let us get right into it!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentDidMount:&lt;/strong&gt; During the Mounting phase, this is invoked immediately after the initial render method. This method can be considered the original "useEffect" hook (&lt;em&gt;with the empty dependency&lt;/em&gt;). So, componentDidMount is used for extended running procedures, like fetching data. See how functional component's, useEffect, and class component's, componentDidMount, are similar, below:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;useEffect&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--usBjSn6K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obz7axqintm6yu9k6kb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--usBjSn6K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obz7axqintm6yu9k6kb6.png" alt="Image description" width="522" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;componentDidMount&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jMxLhbdx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/moas853d906mjec6eawh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jMxLhbdx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/moas853d906mjec6eawh.png" alt="Image description" width="554" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentDidUpdate:&lt;/strong&gt; Moving on to the Updating phase, the method componentDidUpdate is invoked right after an update occurs. It must be enclosed in a conditional statement to prevent an infinite loop (&lt;em&gt;see example below&lt;/em&gt;). Also, notice the repetitive code in the fetch. Another reason, useEffect is more widely used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1vxd2ZCe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6q1ax6wamuuuhe3tqlt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1vxd2ZCe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6q1ax6wamuuuhe3tqlt.png" alt="Image description" width="613" height="344"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;componentWillUnmount:&lt;/strong&gt; Lastly, at the Un-mounting phase, componentWillUnmount is invoked prior to the component getting unmounted and destroyed. Basically, the component is deleted and the page is cleared. One thing to note about this phase; &lt;strong&gt;Never&lt;/strong&gt; call a setState() on this method, as nothing will be rendered. See an example below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9UWFEY2F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kou0tckwnh1g0qrxha4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9UWFEY2F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kou0tckwnh1g0qrxha4.png" alt="Image description" width="547" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are more lifecycle methods that are not used as frequently. Mounting on initial render, updating after a render, and un-mount before deleting a page are core methods that should be remembered. I hope you've gained a little more insight on how class components operate to print your ideas to paper.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The 7 Layers of OSI</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Mon, 10 Jan 2022 07:13:01 +0000</pubDate>
      <link>https://dev.to/anqirek/the-7-layers-of-osi-1jld</link>
      <guid>https://dev.to/anqirek/the-7-layers-of-osi-1jld</guid>
      <description>&lt;p&gt;The seven layers of the internet. Specifically, computer systems framework used to communicate over a network. This is referred to as the OSI(Open System Interconnection) Model. The OSI model is really just a concept, first implemented by the majority of Computer companies in the 1980s. It's not a tangible protocol. It doesn't have any functions, or . It just helps us better understand the processes occurring.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LMy8RB3L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdge9oyuzwoiqomsld3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LMy8RB3L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdge9oyuzwoiqomsld3g.png" alt="Image description" width="880" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typically (as you can also see in the picture above), the OSI model is presented and read in descending order, but for general understanding purposes, I will start from the first(bottom) layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physical (Layer 1):&lt;/strong&gt; As the name states, these are the physical connections that connect devices. Think, internet cables, wireless connections, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Link (Layer 2):&lt;/strong&gt;  This layer connects and disconnects any connection between two nodes. This layer communicates using bits. There are two sub-layers within this, LLC(Logical Link Control and MAC (Media Access Control). The former controls the flow and order of frames, error checks, and identifies network protocols. The latter, uses MAC Addresses(which can be considered as a node ID), to send and receive data between devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network (Layer 3):&lt;/strong&gt; This is where you unplug and plug in the router, and become your household's savior. This layer handles switches and routing, using logical (non-physical) routes to transmit data. Basically, it uses addressing to route packets to its destination. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transport (Layer 4):&lt;/strong&gt; This layer handles data transfer between systems and/or hosts. Now that it has data, and needs to transfer, how much data needs to be sent? When and where, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session(Layer 5):&lt;/strong&gt; Establishes communication channels for two computers and/or network devices to speak with one another. This is a prime example of perfect communication skills. A computer starts a session, waits until data is transferred, and when done, the conversation ends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Presentation(Layer 6):&lt;/strong&gt; Helps translate the network data to a form that application itself can understand, and vice versa.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application (Layer 7):&lt;/strong&gt; Information here is received by end-users where software such as web-browsers,FTP, helps display that incoming data to users.&lt;/p&gt;

&lt;p&gt;These are just basic definitions for the OSI model. There are many(and I mean &lt;strong&gt;MANY&lt;/strong&gt;) sources out there that delves deep into each layer. Although still widely used, much of the modern internet is based on the TCP/IP model.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Making the Switch...</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Fri, 19 Nov 2021 14:17:51 +0000</pubDate>
      <link>https://dev.to/anqirek/making-the-switch-np9</link>
      <guid>https://dev.to/anqirek/making-the-switch-np9</guid>
      <description>&lt;p&gt;At the start of my tech career, if you would have told me I'll be in a coding bootcamp in a few years, I would have thought you were crazy. Why? I believed it was extremely out of reach.&lt;br&gt;
    Most colleagues, friends, and professionals I know that changed careers in IT, have switched from Software Engineering to Network Engineering. Usually citing plainness, and tediousness of coding as the main reasons for their decision.&lt;br&gt;
   I started my career working in Helpdesk support. As the company was small, after a short time, I touched all levels of Networking, from installing apps, to using heat maps, and setting up Networks from the bottom up. I enjoyed the challenge of building out a network from scratch. More than that, when it aligned with what the client needs were(I'm looking at you, bandwidth), that generally made me happy. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pY9donsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/delx4lm7b3t90gl9cof8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pY9donsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/delx4lm7b3t90gl9cof8.png" alt="Image description" width="710" height="722"&gt;&lt;/a&gt;&lt;em&gt;Source:&lt;a href="https://community.fs.com/blog/tcpip-vs-osi-whats-the-difference-between-the-two-models.html"&gt;https://community.fs.com/blog/tcpip-vs-osi-whats-the-difference-between-the-two-models.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After working in Helpdesk for a few years, I moved into more of a hybrid role, splitting onsite, remote, and managerial work. From here on, I worked with various departments, assisting with NOC, Escalation, and the Solution teams. I think this is where I became interested in programming. It was the only department I didn't directly work with, but collaborated a few times and my interest was piqued.&lt;br&gt;
   I also learned a valuable lesson during this period. Why I enjoyed Networking, had nothing to do with Networking, and more so, who I was as a person. As the company grew, I realized the values I held, were no longer applicable.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FKOM-f7q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xfzyhci73faib6p0ywa.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FKOM-f7q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xfzyhci73faib6p0ywa.JPG" alt="Image description" width="880" height="1173"&gt;&lt;/a&gt;&lt;br&gt;
  I did a few free coding courses, (CodeAcademy, Solo learn, among others..) but was very hesitant about taking it a step further. I was comfortable, complacent, and it wasn't a decision I could just make on a whim. &lt;br&gt;
  The longer I fretted over this, the unhappier I was. So...I just moved. Once I made that decision, a weight was lifted off my shoulders, and out my pockets, but I was satisfied with my decision.&lt;br&gt;
   After a few months into the bootcamp, I believe I made the right decision. Although, this is not easy, by any means, I am moving forward, learning new things everyday.  I do agree, some of what I've learned has been tedious as it's been daunting, though this has been the most creative freedom I've had in a long time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cover Source:&lt;a href="https://www.nytimes.com/2020/07/01/technology/personaltech/make-your-tech-last-longer.html"&gt;https://www.nytimes.com/2020/07/01/technology/personaltech/make-your-tech-last-longer.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Show me some Class!</title>
      <dc:creator>AnthonyH00</dc:creator>
      <pubDate>Thu, 04 Nov 2021 18:08:03 +0000</pubDate>
      <link>https://dev.to/anqirek/show-me-some-class-4eng</link>
      <guid>https://dev.to/anqirek/show-me-some-class-4eng</guid>
      <description>&lt;p&gt;Class Components.&lt;/p&gt;

&lt;p&gt;If you’re new to Software Development, specifically, React, you may have heard of functional components. Maybe you’ve seen knowledge bases mention class. Maybe, you’ve long searched for an answer and of course, didn’t find it (which almost NEVER happens).&lt;br&gt;
What exactly is it?&lt;br&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%2Fqxtgl0wdmu3jvxhw09jf.jpeg" 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%2Fqxtgl0wdmu3jvxhw09jf.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Class Components are slow, robust ways to define React components. They consist of functions that add functionality to the application. As someone familiar with functional components, class components was interesting to grasp. There are some key features that are unique to it.&lt;/p&gt;

&lt;p&gt;First, class components have base access to the state. State determines the current behavior of the component, and is changed by calling the setState() function. Simply, whenever the current state needs to change, the setState() interprets the change.&lt;br&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%2Fuhdv68v6x2p8oazmayfj.png" 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%2Fuhdv68v6x2p8oazmayfj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Secondly, class components have access to the React lifecycle. Now, you may be asking what in the world is this? You know what, so did I. I’m still asking myself this question. These are basically the React lifecycle from a variety of points during app creation (fetching data, database creation) to inputting elements in the DOM. We’ll cover the three main phases: Mounting, Updating, and Un-mounting.&lt;/p&gt;

&lt;p&gt;Mounting:&lt;br&gt;
  At this phase, we’re inputting elements into the DOM. Right before mount occurs, the constructor() must be called. The constructor() initializes the local state. This means, you can set the current state directly. As for setState(), that must be used in any other method instead. The constructor is also where this.props object is implemented. In order to use the local this.props, super(props) method must be called, meaning you cannot use this until after the parent constructor (super),is called. Super just refers to the parent class constructor.&lt;br&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%2Ftw2341x298gs4vvytrlo.png" 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%2Ftw2341x298gs4vvytrlo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Updating: &lt;br&gt;
  This phase includes the only required method in class components, render(). Render has to return some type of data, even if it is null. Why? It's because by default, the component file calls the render method to display the JSX or HTML data.&lt;/p&gt;

&lt;p&gt;Un-mounting:&lt;br&gt;
  When you no longer want a component in your DOM (because it randomly broke, per usual with code), and want to remove the component, this method is called. This phase is pretty straightforward. When a component is deleted, this method is called. When you're ready to press that red button you're receiving  "DO NOT PRESS THIS BUTTON!" alerts for, press it and see what happens, live a little.&lt;br&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%2Fm1r0ss9zyqyqjgzbxhpo.gif" 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%2Fm1r0ss9zyqyqjgzbxhpo.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you do not leave here more confused than when you got here, I've failed you. Do not fret though, Class Components get much MUCH, more granular than this. I purposefully left out lifecycle hooks for each phase. I'll go into this in a separate post (&lt;em&gt;wink, wink&lt;/em&gt;). I wanted you to have a base understanding of class components and how it works. What are class based components? How do they work? Hopefully this answers questions like these. Lastly, this is for someone beginning in the world of programming, A fine world, that one day, you'll be creating yourself.&lt;br&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%2F437ikih5wqw3dwhou85u.gif" 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%2F437ikih5wqw3dwhou85u.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

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