<?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: Shaydee Coder</title>
    <description>The latest articles on DEV Community by Shaydee Coder (@shaydeecoder).</description>
    <link>https://dev.to/shaydeecoder</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%2F459300%2Fdeae1b66-b6c5-4045-b993-2a33b50673b3.png</url>
      <title>DEV Community: Shaydee Coder</title>
      <link>https://dev.to/shaydeecoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaydeecoder"/>
    <language>en</language>
    <item>
      <title>Reminiscing On My Software Development Journey</title>
      <dc:creator>Shaydee Coder</dc:creator>
      <pubDate>Mon, 18 Oct 2021 13:48:30 +0000</pubDate>
      <link>https://dev.to/shaydeecoder/reminiscing-on-my-software-development-journey-5g0l</link>
      <guid>https://dev.to/shaydeecoder/reminiscing-on-my-software-development-journey-5g0l</guid>
      <description>&lt;p&gt;It is funny how whenever I learn how to use a new technology, I always ask myself &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When will I be confident enough to start building with this technology?.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I asked myself this question when I couldn't make websites responsive on all devices, and now I can build responsive websites without any issues.&lt;/p&gt;

&lt;p&gt;Then, I started learning bootstrap, I asked myself this same question until I built a website with it by just studying their documentation one Sunday after I got back from church.&lt;/p&gt;

&lt;p&gt;I got so good with bootstrap that it hurts me to see people say it can't do certain things, I'd volunteer to do that task using bootstrap which was said was unable to get the task done.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not say a technology is incapable of doing something, instead say you don't know how to get that task done with the technology. Not knowing how to do something with a technology does not mean the technology is incapable of getting the task done.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I've mentored a lot of developers on how to build responsive websites without having to jump through the hurdles I had to jump.&lt;/p&gt;

&lt;p&gt;I knew what it was like to struggle with these technologies and wanting to understand them badly.&lt;/p&gt;

&lt;p&gt;I guess this made mentoring others much easier for me.&lt;/p&gt;

&lt;p&gt;I asked myself this question again when I started learning JavaScript, in fact, I gave up at this stage. I told myself software development wasn't for me.&lt;/p&gt;

&lt;p&gt;Then I saw a tweet someone posted telling another person to register for an internship. &lt;/p&gt;

&lt;p&gt;From the tweet, the so-called "internship" was actually a competition and not meant for beginners.&lt;/p&gt;

&lt;p&gt;I also applied for the internship, what will I lose even if I get evicted at the beginning of the program? nothing, I'd lose absolutely nothing!&lt;/p&gt;

&lt;p&gt;By the time I saw the tweet, I had already stopped studying and given up.&lt;/p&gt;

&lt;p&gt;Two weeks went by and I didn't get evicted. I had submitted all my tasks before deadlines.&lt;/p&gt;

&lt;p&gt;In the third week, we were splitted into teams and my team was to build five hotel website templates.&lt;/p&gt;

&lt;p&gt;I led the sub-team that developed three out of five of the templates we were given in two days.&lt;/p&gt;

&lt;p&gt;After we were done with our task, we were free for the week so we decided to introduce ourselves and get to know each other.&lt;/p&gt;

&lt;p&gt;You're surprised, right? Yeah, I know. The internship was so intense that we didn't have the time to start introducing ourselves in the beginning because no one wants to be evicted.&lt;/p&gt;

&lt;p&gt;So, while we were getting to knowing each other, somebody said he had to google some of my code to understand what I did.&lt;/p&gt;

&lt;p&gt;This person was somebody I was looking up to because my JavaScript knowledge was zero at that time and the code he googled to understand was just CSS.&lt;/p&gt;

&lt;p&gt;I thought everyone coding JavaScript had already mastered CSS, so I was surprised why he had to google to understand the CSS code written by someone who had given up and stopped studying.&lt;/p&gt;

&lt;p&gt;It was at this moment I told myself I cannot give up just yet. During the internship, I saw a lot of people who were looking up to me also.&lt;/p&gt;

&lt;p&gt;"I can't let these people down by giving up", so I said to myself. So after the internship I went back to JavaScript and I conquered, no still conquering, I mean. But I'm comfortable and confident enough with vanilla JavaScript now.&lt;/p&gt;

&lt;p&gt;I'm learning #React now, and I'm asking myself "when will I be proficient and confident with it?"&lt;/p&gt;

&lt;p&gt;This was what I asked myself last week before remembering I once asked myself this when I was struggling with CSS media queries, then bootstrap, and then JavaScript. &lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>React Hooks - Understanding the useEffect Hook</title>
      <dc:creator>Shaydee Coder</dc:creator>
      <pubDate>Sat, 11 Sep 2021 08:02:40 +0000</pubDate>
      <link>https://dev.to/shaydeecoder/react-hooks-understanding-the-useeffect-hook-g86</link>
      <guid>https://dev.to/shaydeecoder/react-hooks-understanding-the-useeffect-hook-g86</guid>
      <description>&lt;p&gt;Since I started working with React Hooks, I've finally had a grasp of how &lt;code&gt;useEffect&lt;/code&gt; works.&lt;/p&gt;

&lt;p&gt;If you already have experience working with the life-cycle methods in class components, &lt;code&gt;useEffect&lt;/code&gt; shouldn't be difficult for you to understand.&lt;/p&gt;

&lt;p&gt;Just as in a class component, &lt;code&gt;useEffect&lt;/code&gt; uses the different phases of a component's life-cycle in a functional component. If you're wondering what the life-cycle phases are, here you go;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initial Rendering/Mounting Phase&lt;/li&gt;
&lt;li&gt;Updating Phase&lt;/li&gt;
&lt;li&gt;Unmounting Phase&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Initial Rendering/Mounting Phase
&lt;/h3&gt;

&lt;p&gt;This is the phase when the component is about to start it's life journey and make it's way to the DOM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating Phase
&lt;/h3&gt;

&lt;p&gt;Once the component gets added to the DOM it can potentially update and re-render only when a prop or state change occurs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unmounting Phase
&lt;/h3&gt;

&lt;p&gt;This is the final phase of a component's life-cycle in which the component is removed from the DOM.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;useEffect&lt;/code&gt; function accepts two parameters, a call-back function and the life-cycle phase as a second parameter i.e when you want the call-back function to be executed.&lt;/p&gt;

&lt;p&gt;The second parameter could be left empty, and if you need to add a second parameter, it would always be an array. Either an empty array or an array containing a piece of state.&lt;/p&gt;

&lt;p&gt;Whenever an empty array is used as a second parameter, it means the call-back function inside the &lt;code&gt;useEffect&lt;/code&gt; should be executed in the initial rendering phase e.g.&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; {}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When an array holding a piece of state is used as the second parameter, it means the call-back function should be executed in the initial rendering phase and also in the updating phase i.e when the state in the array is changed or updated e.g.&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; {}, [data]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a second parameter is not declared, it means the call-back should be executed in the initial rendering phase and whenever ANY state is changed or in the initial rendering phase and EVERYTIME the component is updated e.g.&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; {});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's discuss the unmounting phase of the &lt;code&gt;useEffect&lt;/code&gt; Hook, this hook returns only one thing which is a function, it doesn't return any other thing except a function. Before proceeding with the unmounting phase, let's discuss in details about &lt;code&gt;useEffect&lt;/code&gt; and asynchronous functions. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;useEffect&lt;/code&gt; hook doesn't accept an asynchronous function as a callback function. If you need to use an asynchronous function in &lt;code&gt;useEffect&lt;/code&gt;, then you will have to use it in a callback function and not directly, as a callback function e.g.&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; {
    // Your asynchronous function here inside the callback function
    async () =&amp;gt; {}
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's get back to the unmounting phase of &lt;code&gt;useEffect&lt;/code&gt;, remember that this hook only returns a function, this returned function is not called immediately whenever &lt;code&gt;useEffect&lt;/code&gt; is executed. This returned function is stored in memory and only runs just before another execution of the same useEffect where the function was returned.&lt;/p&gt;

&lt;p&gt;Let me walk you through an example that will help you grasp the concept more;&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; {
    console.log("1. The useEffect logic");

    /* The unmounting phase */
    return () =&amp;gt; {
         console.log("2. The unmounting phase");
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code snippet would log to the console &lt;code&gt;1. The useEffect logic&lt;/code&gt; in the first execution of the useEffect callback function. Now, because the useEffect has been executed once, the returned function is then stored in memory waiting for the useEffect to be executed for the second time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Console output
// 1. The useEffect Logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the &lt;code&gt;useEffect&lt;/code&gt; is executed the second time, the returned function stored in memory during the first execution would then be executed before running the second execution of the &lt;code&gt;useEffect&lt;/code&gt; hook. Now, the console output would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Console output
// 2. The unmounting phase
// 1. The useEffect logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the second execution, the returned function is then stored again in memory patiently waiting for another useEffect call to trigger its execution, and this is how the cycle goes on over and over again.&lt;/p&gt;

&lt;p&gt;Wow! You read it all till this point 😊, I hope this was helpful understanding how useEffect work in a functional component?&lt;/p&gt;

&lt;p&gt;Thank you for reading this far 😊&lt;/p&gt;

</description>
      <category>react</category>
      <category>reacthook</category>
      <category>useeffect</category>
      <category>lifecycle</category>
    </item>
  </channel>
</rss>
