<?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: jmedel1</title>
    <description>The latest articles on Forem by jmedel1 (@jmedel1).</description>
    <link>https://forem.com/jmedel1</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%2F1062750%2Fb6daaf7e-d028-4124-be90-5b04a94f2d03.png</url>
      <title>Forem: jmedel1</title>
      <link>https://forem.com/jmedel1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jmedel1"/>
    <language>en</language>
    <item>
      <title>Mastering the useEffect Hook in React</title>
      <dc:creator>jmedel1</dc:creator>
      <pubDate>Sun, 02 Jul 2023 01:27:00 +0000</pubDate>
      <link>https://forem.com/jmedel1/mastering-the-useeffect-hook-in-react-335j</link>
      <guid>https://forem.com/jmedel1/mastering-the-useeffect-hook-in-react-335j</guid>
      <description>&lt;p&gt;Hey there, fellow newbie coder! If you're just getting started with React and feeling a little overwhelmed, don't worry—I've got your back. Today, we're going to dive into one of the coolest things you'll come across: the useEffect hook. It might sound fancy, but trust me, it's a game-changer when it comes to making your React apps shine. So, grab your coding hat and let's explore the wonderful world of useEffect together!&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Understanding the Basics of useEffect:&lt;/strong&gt;&lt;br&gt;
Alright, let's start with the basics. So, what exactly is useEffect? Well, it's a nifty tool that helps you do all sorts of cool stuff in your React components. You know, the things that happen on the side, like fetching data from APIs, updating the page title, or handling events. It's like having a magic wand to make your app do all the behind-the-scenes work!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handling Side Effects with useEffect:&lt;/strong&gt;&lt;br&gt;
Now, here's the cool part: useEffect lets you handle those side effects easily. You can think of it as a special function that runs after your component has rendered. That means you can put all your fetching, event listening, and other awesome stuff right in there. Let's walk through some examples to see how it works.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 1: Fetching data from an API&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;In this example, the useEffect hook is used to fetch data from an API. The fetch request is made inside the useEffect function, and when the data is retrieved, it is stored in the component's state using the setData function.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example 2: Event listeners&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;In this example, the useEffect hook is used to add an event listener to the document. When the component is rendered, the event listener is added, and when the component is unmounted or re-rendered, the cleanup function returned by useEffect removes the event listener.&lt;/p&gt;

&lt;p&gt;These examples illustrate how the useEffect hook can be used to handle different side effects in your React components. Remember, you can put any side effect code inside the useEffect function to execute it at the appropriate time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cleaning Up Effects:&lt;/strong&gt;&lt;br&gt;
Okay, imagine you're throwing a party in your app. It's all fun and games, but what about cleaning up after the party's over? That's where useEffect shines again! It helps you tidy up your code and do any necessary cleanup. Whether it's canceling subscriptions, clearing timers, or releasing resources, useEffect's got your back.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
Congratulations, coding newbie! You've just embarked on an exciting journey with the useEffect hook in React. By mastering this powerful tool, you'll be able to handle side effects, keep your app running smoothly, and create awesome user experiences. So, keep coding, keep exploring, and remember, every coding adventure starts with a single hook. Happy coding!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>codenewbie</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Beginning My Coding Journey</title>
      <dc:creator>jmedel1</dc:creator>
      <pubDate>Tue, 11 Apr 2023 02:35:43 +0000</pubDate>
      <link>https://forem.com/jmedel1/beginning-my-coding-journey-3ja</link>
      <guid>https://forem.com/jmedel1/beginning-my-coding-journey-3ja</guid>
      <description>&lt;p&gt;Hello my name is Jael Medel I am a 26 year old who only began to start coding because I had seen an advertisement on the bathroom stall of my employment facility funny enough! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t41IXGVA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8avl805627fls4ewq4cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t41IXGVA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8avl805627fls4ewq4cg.png" alt="Image description" width="800" height="892"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PATIENCE IS KEY&lt;/strong&gt;&lt;br&gt;
When I enrolled myself in the course for the first time I actually ended up quitting because all the information I was receiving felt so overwhelming and complicated for me that I told myself I would never understand. A couple months later I had a friend of mine encouraging me to take an online web development class together and motivated me to try again. We ended up enrolling together and I am so grateful to my friend for the motivation to try again. For whatever reason somehow I clearly understood the basics of the beginning of the course that I thought were so complicated to learn before I ended up quitting. I used to think moving folders within the terminal, copy &amp;amp; pasting within files, and creating folders was the hardest thing to do. Now I understand if else statements, variables, and still getting used to fully understanding functions! It gave me such a boost to continue going to keep learning now knowing that I slowly but surely will get the hang of it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rh2mexkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nugwje3bcbe0dnuqvwp7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rh2mexkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nugwje3bcbe0dnuqvwp7.gif" alt="Image description" width="345" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CREATING MY FIRST WEB APPLICATION&lt;/strong&gt;&lt;br&gt;
I've only been learning to code now for about 3 months and creating my first web application for class has been a challenging yet rewarding experience. I felt nervous and unsure about what to do. I spent days staying up late researching, reading tutorials, and watching videos, trying to figure out how I could write my code to have it work the way I wanted to. But no matter how much I read or watched, I still felt overwhelmed and unsure about where to begin. It wasn't until I started working on my project that I began to gain confidence. I started by breaking down the project into smaller, more manageable parts.&lt;/p&gt;

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

&lt;p&gt;Planning out the features that I wanted to include in my web application was exciting and I started working on them one by one. I was worried about how my application would look as I was working on it but it slowly was coming to life! There were days when I felt like giving up, when it seemed like every time I fixed one issue, another one popped up. It felt like a never-ending loop, and I was worried about how my application would turn out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6ujAJck1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fawru6ioj2r4u1385pqh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6ujAJck1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fawru6ioj2r4u1385pqh.jpg" alt="Image description" width="548" height="630"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Despite these challenges, I refused to give up. I kept tweaking the code and experimenting with different solutions until I finally found what worked. The most enjoyable thing but also very challenging throughout the whole process to me was adding in the color and design in CSS for my web application. It took a lot of trial and error to find a design that was both aesthetically pleasing and functional. I wanted to create something with colors that matched the theme of my application along with the font! I encountered a lot of mistakes, but I also learned from them. I was able to have more practice learning how to debug errors and how to write clean and efficient code. &lt;/p&gt;

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

&lt;p&gt;It was such a great feeling of satisfaction that came from seeing my code come to life and from knowing that I had created something that was truly my own. As the week came closer to the deadline for the project I was worried about whether my web application was going to be working functionally the way I wanted it to be or if I would be able to meet the requirements set out by the instructors. In the end, though, it was all worth it. When I finally completed my web application, I felt a sense of accomplishment that I had never felt before. I had created something that worked and that I was proud of. Despite the challenges and setbacks, I'm grateful for the experience of creating my first web application. This was an exciting and humbling experience. It may not have been perfect, but it was a start, and I'm eager to continue learning and growing as a programmer. With time and practice, I know that I'll be able to create more sophisticated projects.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>html</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
