<?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: Ayoola Damilare</title>
    <description>The latest articles on DEV Community by Ayoola Damilare (@ayoola_damilare_212d5bde0).</description>
    <link>https://dev.to/ayoola_damilare_212d5bde0</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%2F2450825%2Faccaea84-b791-4926-8bf7-9193ab12bb88.jpg</url>
      <title>DEV Community: Ayoola Damilare</title>
      <link>https://dev.to/ayoola_damilare_212d5bde0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayoola_damilare_212d5bde0"/>
    <language>en</language>
    <item>
      <title>React Native To-Do App: Project</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Wed, 26 Feb 2025 19:58:39 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/react-native-to-do-app-project-3kne</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/react-native-to-do-app-project-3kne</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Building a React Native To-Do App: A Step-by-Step Journey&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Managing tasks efficiently is crucial in today's fast-paced world. With React Native, we can build a powerful and user-friendly task management app that enables users to create, edit, and track their tasks seamlessly. We’ll break down the development process into digestible steps, covering everything from project setup to authentication, task management, and notifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 1: Setting Up Your React Native Project&lt;/strong&gt;&lt;br&gt;
Before diving into the core functionality of our Task Manager app, we need to set up a solid foundation. In this post, we’ll cover installing the necessary tools, initializing a React Native project with Expo, and structuring the project efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install Node.js and npm/yarn&lt;/strong&gt;&lt;br&gt;
To get started, ensure that you have &lt;code&gt;Node.js&lt;/code&gt; installed on your machine. You can download it from &lt;code&gt;Node.js&lt;/code&gt; official website. This will also install npm &lt;em&gt;(Node Package Manager)&lt;/em&gt;, which we’ll use to manage dependencies. Alternatively, you can use yarn, a faster and more efficient package manager.&lt;/p&gt;

&lt;p&gt;To verify the installation, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Initialize a New React Native Project with Expo&lt;/strong&gt;&lt;br&gt;
Expo simplifies React Native development by handling native configurations. To install Expo CLI, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g expo-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, initialize your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo init TaskManagerApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expo will prompt you to choose a template. For this project, select Blank (TypeScript or JavaScript). Once the setup is complete, navigate into the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd TaskManagerApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the project, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo start
or 
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command opens the Expo Developer Tools in your browser, allowing you to test the app on an emulator or a physical device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Set Up Project Structure&lt;/strong&gt;&lt;br&gt;
A well-organized project makes development more efficient. Inside your project, create the following folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TaskManagerApp/
│── src/
│   ├── components/       # Reusable UI components
│   ├── screens/          # Different screens (Login, Tasks, Profile)
│   ├── navigation/       # Navigation configuration
│   ├── services/         # API calls and Firebase interactions
│── App.js                # Root component
│── package.json          # Project dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Install Required Dependencies&lt;/strong&gt;&lt;br&gt;
We need several libraries to build our task management app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;react-navigation – Handles app navigation&lt;/li&gt;
&lt;li&gt;axios – Manages API requests&lt;/li&gt;
&lt;li&gt;firebase – Enables authentication and database storage&lt;/li&gt;
&lt;li&gt;react-native-paper – Provides UI components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install them using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @react-navigation/native axios firebase react-native-paper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also need to install the required navigation dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-native-screens react-native-safe-area-context react-native-gesture-handler react-native-reanimated react-native-vector-icons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;br&gt;
With the project set up, we are now ready to build authentication. In the next post, we’ll implement &lt;em&gt;user login and registration&lt;/em&gt; using &lt;code&gt;Firebase&lt;/code&gt;. Stay tuned!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>reactnative</category>
      <category>ai</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>My React Journey: From Side Projects to Real-World Challenges</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Tue, 28 Jan 2025 18:08:27 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-from-side-projects-to-real-world-challenges-4cf4</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-from-side-projects-to-real-world-challenges-4cf4</guid>
      <description>&lt;h2&gt;
  
  
  Welcome back to my React journey!
&lt;/h2&gt;

&lt;p&gt;If you’ve been following along, you know I’ve been working on a To-Do List Application to sharpen my React skills. But life has a funny way of throwing surprises at you, and mine came in the form of an exciting internship opportunity as a mobile developer using React Native.&lt;/p&gt;

&lt;p&gt;While I haven’t been able to make progress on my To-Do List project, I’ve been diving headfirst into the world of professional development. It’s been a whirlwind of learning, adapting, and growing—both as a developer and as a problem-solver. Today, I want to share my experiences so far, the challenges I’ve faced, and the beauty of working in a real-world codebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Transition: From Side Projects to a Large Codebase&lt;/strong&gt;&lt;br&gt;
When I started my internship, I was both excited and nervous. I had spent months working on personal projects like the To-Do List app, where I had full control over the codebase and the pace of development. But stepping into a large, existing codebase was a whole new ball game.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here’s what I’ve learned so far:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding the Codebase&lt;/strong&gt;&lt;br&gt;
The first challenge was understanding the structure of the code. Unlike my personal projects, where everything was neatly organized (or at least I thought so), the codebase at work was massive, with multiple layers of abstraction, dependencies, and interconnected components. It took time to trace the flow of data, understand the state management system, and figure out how different modules interacted with each other.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip: If you’re ever in a similar situation, start by identifying the entry points of the app and follow the data flow. Tools like React DevTools and logging can be lifesavers!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grasping the Business Logic&lt;/strong&gt;&lt;br&gt;
Writing code is one thing, but understanding why the code exists is another. Every feature in the app is tied to a business requirement, and it’s crucial to understand the “why” behind it. This has been a steep learning curve for me, but it’s also been incredibly rewarding. I’ve started to think beyond just writing functional code and focus on how my work impacts the end user and the business.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collaborating with a Team&lt;/strong&gt;&lt;br&gt;
Working in a team is a whole new experience. There are code reviews, stand-ups, and constant communication with designers, product managers, and other developers. It’s taught me the importance of writing clean, maintainable code and documenting my work so that others can understand it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Beauty of Real-World Development&lt;/strong&gt;&lt;br&gt;
Despite the challenges, this experience has been nothing short of beautiful. Here’s why:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learning on the Job:&lt;/strong&gt;&lt;br&gt;
Every day brings new opportunities to learn. Whether it’s debugging a tricky issue, optimizing performance, or implementing a new feature, I’m constantly expanding my skill set. I’ve also been exposed to tools and practices that I hadn’t encountered in my personal projects, like CI/CD pipelines, automated testing, and advanced state management libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seeing the Impact of My Work&lt;/strong&gt;&lt;br&gt;
There’s something incredibly satisfying about seeing your code solving problems even with reviews and corrections by the seniors. It’s a reminder that what we do as developers has a tangible impact on people’s lives. Whether it’s a small UI improvement or a new feature, knowing that it makes someone’s day a little easier is incredibly motivating.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Growing as a Developer&lt;/strong&gt;&lt;br&gt;
This internship is pushing me out of my comfort zone, forcing me to think critically, ask questions, and seek help when needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What’s Next?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While my To-Do List project is on hold for now, here’s what you can expect from me in the coming weeks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updates on My Internship Experience: I’ll dive deeper into specific challenges I’ve faced and how I’ve overcome them.&lt;/li&gt;
&lt;li&gt;React Native Insights: As I continue working with React Native, I’ll share tips, tricks, and lessons learned.&lt;/li&gt;
&lt;li&gt;Reviving the To-Do List Project: Once things settle down, I’ll pick up where I left off and add new features to the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This journey has been challenging, but it’s also been incredibly rewarding. I’ve learned that growth happens outside of your comfort zone, and every challenge is an opportunity to become a better developer.&lt;/p&gt;

&lt;p&gt;To anyone out there who’s just starting their journey or feeling overwhelmed by a new role, remember this: &lt;em&gt;It’s okay to not know everything&lt;/em&gt;. What matters is your willingness to learn, adapt, and keep moving forward.&lt;/p&gt;

&lt;p&gt;Stay tuned for more updates, and as always, &lt;em&gt;I’d love to hear your thoughts, feedback, or questions.&lt;/em&gt; Let’s grow together! 🚀&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>oop</category>
      <category>reactnative</category>
      <category>mobile</category>
    </item>
    <item>
      <title>My React Journey: Project</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Wed, 15 Jan 2025 19:53:38 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-project-2b66</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-project-2b66</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Building a To-Do List Application&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Welcome back to my React journey! If you’re just joining in, you’re in for an exciting ride. I’ve taken on the challenge of improving my React skills by working on hands-on projects, and one of them is this &lt;code&gt;To-Do List Application&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Why a to-do list, you ask? Well, think about it. Task management is something we all deal with daily, whether it’s managing personal errands or professional deadlines. Creating a project like this not only sharpens my coding skills but also solves a real-world problem—a win-win!&lt;/p&gt;

&lt;p&gt;Through this journey, I’m not just building an app; I’m diving deep into React concepts like state management, reusable components, and creating intuitive user interfaces. It’s about growing, learning, and sharing my experiences with you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Project?&lt;/strong&gt;&lt;br&gt;
When starting a learning journey, the key is to focus on projects that are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Practical&lt;/strong&gt;: Everyone needs a task management tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Challenging&lt;/strong&gt;: A to-do list may sound simple, but I guess incorporating features like moving tasks up and down, real-time updates, and user management pushes you to think beyond the basics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fun&lt;/strong&gt;: There’s nothing like seeing a functional app that you’ve built from scratch!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this project, I’m exploring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React Hooks like useState for dynamic updates.&lt;/li&gt;
&lt;li&gt;Intuitive design principles for a clean, responsive interface.&lt;/li&gt;
&lt;li&gt;Communication between a React front-end and a backend API for seamless functionality.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;br&gt;
This is just the beginning! I’ll be updating this series daily as the project progresses. Each day will bring new challenges, new learnings, and of course, new features to the app.&lt;/p&gt;

&lt;p&gt;I’m also open to feedback and corrections. If you spot something I could do better or know a more efficient way to handle certain aspects, don’t hesitate to drop a comment or suggestion. This journey isn’t just about building—it’s about growing, and I value your input!&lt;/p&gt;

&lt;p&gt;So, whether you’re a fellow developer, a tech enthusiast, or just curious about the process, stay glued to this page. You’ll get to see how the app evolves, from simple task addition to advanced functionalities like notifications and user management.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Stay tuned&lt;/em&gt; 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>My React Journey: Day 28</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Tue, 31 Dec 2024 14:28:24 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-28-4o31</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-28-4o31</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Building a To-Do List in React&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Today, I worked on a React project to create a simple yet powerful &lt;code&gt;To-Do List App&lt;/code&gt;. This project deepened my understanding of &lt;code&gt;React hooks&lt;/code&gt;, &lt;code&gt;state management&lt;/code&gt;, and &lt;code&gt;event handling&lt;/code&gt; while allowing me to enhance the functionality with additional features like moving tasks up or down.&lt;/p&gt;

&lt;p&gt;Here’s a breakdown of what I learned and implemented.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Setting Up the Component&lt;/strong&gt;&lt;br&gt;
I structured my &lt;code&gt;ToDoList.jsx&lt;/code&gt; to use the &lt;code&gt;useState hook&lt;/code&gt; for managing tasks. This allowed me to dynamically update and render the task list. Below is the basic setup for managing tasks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

export default function ToDoList() {
  const [tasks, setTasks] = useState([]);
  const [newTask, setNewTask] = useState("");

  function handleInputChange(event) {
    setNewTask(event.target.value); // Enables us to see what we type
  }

  function addTask() {
    if (newTask.trim() !== "") {
      setTasks(t =&amp;gt; [...t, newTask]); // Adds the new task to the task list
      setNewTask(""); // Resets the input field
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Adding and Deleting Tasks&lt;/strong&gt;&lt;br&gt;
I learned how to manipulate state to add and delete tasks. The &lt;code&gt;addTask&lt;/code&gt; function checks if the input is valid before adding it, while &lt;code&gt;deleteTask&lt;/code&gt; removes a specific task based on its index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function deleteTask(index) {
  const updatedTasks = tasks.filter((_, i) =&amp;gt; i !== index); // Removes the task at the given index
  setTasks(updatedTasks);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Moving Tasks Up and Down&lt;/strong&gt;&lt;br&gt;
A key enhancement to the project was implementing task reordering. The &lt;code&gt;moveTaskUp&lt;/code&gt; and &lt;code&gt;moveTaskDown&lt;/code&gt; functions rearrange tasks based on their indices:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function moveTaskUp(index) {
  if (index &amp;gt; 0) {
    const updatedTasks = [...tasks];
    [updatedTasks[index], updatedTasks[index - 1]] = [updatedTasks[index - 1], updatedTasks[index]];
    setTasks(updatedTasks);
  }
}

function moveTaskDown(index) {
  if (index &amp;lt; tasks.length - 1) {
    const updatedTasks = [...tasks];
    [updatedTasks[index], updatedTasks[index + 1]] = [updatedTasks[index + 1], updatedTasks[index]];
    setTasks(updatedTasks);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Adding Styles with CSS&lt;/strong&gt;&lt;br&gt;
To make the app visually appealing, I applied custom styles in &lt;code&gt;index.css&lt;/code&gt;. Here are some of the highlights:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Button Styling:&lt;/em&gt;&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;button {
  font-size: 1.7rem;
  font-weight: bold;
  padding: 10px 20px;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.5s ease;
}
.add-button {
  background-color: hsl(125, 47%, 54%);
}
.add-button:hover {
  background-color: hsl(125, 47%, 44%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Task Item Styling:&lt;/em&gt;&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;li {
  font-size: 2rem;
  font-weight: bold;
  padding: 15px;
  background-color: hsl(0, 0%, 97%);
  margin-bottom: 10px;
  border: 3px solid hsla(0, 0%, 85%, 0.75);
  border-radius: 5px;
  display: flex;
  align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Complete To-Do List in Action&lt;/strong&gt;&lt;br&gt;
Here’s how everything comes together in the &lt;code&gt;ToDoList.jsx&lt;/code&gt; component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return (
  &amp;lt;div className='to-do-list'&amp;gt;
    &amp;lt;h1&amp;gt;To-Do List&amp;lt;/h1&amp;gt;
    &amp;lt;div&amp;gt;
      &amp;lt;input 
        type='text'
        placeholder='Enter a task...'
        value={newTask}
        onChange={handleInputChange}
      /&amp;gt;
      &amp;lt;button className='add-button' onClick={addTask}&amp;gt;
        Add
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;ol&amp;gt;
      {tasks.map((task, index) =&amp;gt; (
        &amp;lt;li key={index}&amp;gt;
          &amp;lt;span className='text'&amp;gt;{task}&amp;lt;/span&amp;gt;
          &amp;lt;button className='delete-button' onClick={() =&amp;gt; deleteTask(index)}&amp;gt;Delete&amp;lt;/button&amp;gt;
          &amp;lt;button className='move-button' onClick={() =&amp;gt; moveTaskUp(index)}&amp;gt;☝️&amp;lt;/button&amp;gt;
          &amp;lt;button className='move-button' onClick={() =&amp;gt; moveTaskDown(index)}&amp;gt;👇&amp;lt;/button&amp;gt;
        &amp;lt;/li&amp;gt;
      ))}
    &amp;lt;/ol&amp;gt;
  &amp;lt;/div&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Key Takeaways&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;React Hooks: The useState hook is an efficient way to manage local component states.&lt;/li&gt;
&lt;li&gt;Event Handling: Functions like handleInputChange, addTask, and deleteTask showcase how user interactions can update the UI.&lt;/li&gt;
&lt;li&gt;Dynamic List Rendering: Using map to iterate over tasks makes the app dynamic and responsive to changes.&lt;/li&gt;
&lt;li&gt;Styling Best Practices: Combining CSS hover effects and transitions enhances user experience.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;One step at a time&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;&lt;br&gt;
You can access the full source code for this project on GitHub:&lt;br&gt;
👉 To-Do List React App Repository&lt;/p&gt;

&lt;p&gt;Feel free to explore, fork, and contribute to the project!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 27</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Mon, 30 Dec 2024 22:48:11 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-27-49b8</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-27-49b8</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;React Router&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Today’s focus is on mastering &lt;code&gt;React Router&lt;/code&gt;, a key tool for building seamless navigation in React single-page applications (SPAs). Let me walk you through my learning journey and discoveries!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Learned from Building Navigation with React Router&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1.Setup and Installation:&lt;/strong&gt;&lt;br&gt;
To start using React Router, I installed the library with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-router-dom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I imported the necessary modules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createBrowserRouter, RouterProvider } from 'react-router-dom';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Creating Routes:&lt;/strong&gt;&lt;br&gt;
I created routes using &lt;code&gt;createBrowserRouter&lt;/code&gt;, defining paths and linking them to specific components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&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;const router = createBrowserRouter([
  { path: '/', element: &amp;lt;HomePage /&amp;gt; },
  { path: '/profiles', element: &amp;lt;ProfilesPage /&amp;gt; },
  { path: '/profiles/:profileId', element: &amp;lt;ProfilePage /&amp;gt; },
]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Dynamic URLs: The route  &lt;code&gt;path:'/profiles/:profileId'&lt;/code&gt; demonstrates dynamic routing. It allows me to render a unique profile page based on the &lt;code&gt;profileId&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Error Handling: Adding &lt;code&gt;errorElement&lt;/code&gt; ensures that users who navigate to invalid URLs see a &lt;code&gt;404 Not Found&lt;/code&gt; page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Handling 404 Errors:&lt;/strong&gt;&lt;br&gt;
I created a custom error page (NotFoundPage.jsx) using React Router’s Link component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Link to="/"&amp;gt;Home&amp;lt;/Link&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows navigation back to the homepage without a full browser refresh, maintaining the SPA experience.&lt;/p&gt;

&lt;p&gt;4.Mapping Components Dynamically:&lt;br&gt;
In &lt;code&gt;ProfilesPage.jsx&lt;/code&gt;, I used the &lt;code&gt;map&lt;/code&gt; method to dynamically generate links for each profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{profiles.map((profile) =&amp;gt; (
  &amp;lt;Link key={profile} to={`/profiles/${profile}`}&amp;gt;
    Profile {profile}
  &amp;lt;/Link&amp;gt;
))}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it scalable as new profiles can be added without rewriting the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.Page Structure:&lt;/strong&gt;&lt;br&gt;
Each page/component serves a specific purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HomePage: Displays the default content when users visit /.&lt;/li&gt;
&lt;li&gt;ProfilesPage: Lists links to individual profiles.&lt;/li&gt;
&lt;li&gt;ProfilePage: Displays a placeholder for dynamic content related to a specific profile.&lt;/li&gt;
&lt;li&gt;NotFoundPage: Handles invalid URLs, enhancing user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6.Avoiding Full Page Refreshes:&lt;/strong&gt;&lt;br&gt;
I learned that using the &lt;code&gt;&amp;lt;Link&amp;gt;&lt;/code&gt; component instead of the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tag prevents unnecessary full-page reloads. This keeps the application fast and responsive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.Rendering Nested Views:&lt;/strong&gt;&lt;br&gt;
With React Router, I can easily render nested components or layouts by structuring my routes efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
React Router is an essential tool for building rich and user-friendly SPAs. Its ability to dynamically route, handle errors gracefully, and ensure a seamless navigation experience is powerful.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 26</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Sat, 28 Dec 2024 21:18:03 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-26-3759</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-26-3759</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Lifecycle Methods &amp;amp; Conditional Rendering&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Today marks another step in my React learning journey, and it’s all about Lifecycle Methods and Conditional Rendering. Understanding how React components are born, grow, and eventually leave the DOM has been a game-changer for me. Add to that the ability to conditionally display content based on user interactions, and suddenly, building dynamic, user-friendly apps feels so sweet!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lifecycle Methods in React Functional Components&lt;/strong&gt;&lt;br&gt;
Lifecycle has 3 steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Initial Step (Mounting Phase)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Happens when the component renders for the first time.&lt;/li&gt;
&lt;li&gt;useEffect with an empty dependency array ([]) runs only during this phase.
&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  console.log("Component mounted");
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;2.Update Step:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Triggered when state or props change.&lt;/li&gt;
&lt;li&gt;React re-runs your function component, re-computing states and passing updated props.&lt;/li&gt;
&lt;li&gt;Use useEffect with specific dependencies to handle changes:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  console.log("State or props updated!");
}, [dependency1, dependency2]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;3. Exit / Unmounting Phase:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Happens when the component is removed from the DOM.&lt;/li&gt;
&lt;li&gt;Cleanup code can be added in the return function of useEffect to release memory.
&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const handleResize = () =&amp;gt; console.log("Resized!");
  window.addEventListener("resize", handleResize);

  return () =&amp;gt; {
    window.removeEventListener("resize", handleResize);
    console.log("Component unmounted, cleanup done!");
  };
}, []);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conditional Rendering&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This technique is essential for dynamically rendering components or elements based on conditions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ternary Operator&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;UserGreetings example&lt;/em&gt;&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;return props.isLoggedIn ? (
  &amp;lt;h2 className='welcome-message'&amp;gt;Welcome {props.username}&amp;lt;/h2&amp;gt;
) : (
  &amp;lt;h2 className='login-prompt'&amp;gt;Please log in to continue&amp;lt;/h2&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Short-Circuit Evaluation&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
For simpler conditions, you can use &amp;amp;&amp;amp; to render components only when a condition is true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return props.isLoggedIn &amp;amp;&amp;amp; &amp;lt;h2&amp;gt;Welcome, {props.username}&amp;lt;/h2&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Inline Conditional Styles&lt;/strong&gt;&lt;br&gt;
You can also dynamically style components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const messageStyle = props.isLoggedIn
  ? { color: "green" }
  : { color: "red" };

return &amp;lt;h2 style={messageStyle}&amp;gt;Welcome, {props.username}&amp;lt;/h2&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;This keeps getting better day-by-day&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>mobile</category>
      <category>javascript</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 25</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Fri, 27 Dec 2024 20:20:45 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-25-5f45</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-25-5f45</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Hooks - &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What Are React Hooks?&lt;/strong&gt;&lt;br&gt;
Hooks are special functions introduced in React v16.8 that allow functional components to use React features like state and lifecycle methods without writing class components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. useState Hook&lt;/strong&gt;&lt;br&gt;
The useState hook is used to add state to functional components.&lt;br&gt;
It provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A state variable to store data.&lt;/li&gt;
&lt;li&gt;A setter function to update the state.
Syntax:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [state, setState] = useState(initialValue);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&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;import React, { useState } from 'react';

export default function MyComponent() {
  const [name, setName] = useState("Guest");
  const [age, setAge] = useState(0);

  const updateName = () =&amp;gt; setName("Damilare");
  const updateAge = () =&amp;gt; setAge(age + 2);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;Name: {name}&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={updateName}&amp;gt;Update Name&amp;lt;/button&amp;gt;

      &amp;lt;p&amp;gt;Age: {age}&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={updateAge}&amp;gt;Increase Age&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. useEffect Hook&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;useEffect&lt;/code&gt; hook allows you to perform side effects in functional components. Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching data from an API.&lt;/li&gt;
&lt;li&gt;Subscribing to events.&lt;/li&gt;
&lt;li&gt;Directly updating the DOM (e.g., changing document.title).
&lt;strong&gt;&lt;em&gt;Syntax:&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(callback, [dependencies]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;callback: The function to execute.&lt;/li&gt;
&lt;li&gt;[dependencies]: Array of values that the effect depends on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Behavior Based on Dependencies:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;useEffect(() =&amp;gt; { ... });
Runs after every re-render of the component.&lt;/li&gt;
&lt;li&gt;useEffect(() =&amp;gt; { ... }, []);
Runs only on mount (like componentDidMount).&lt;/li&gt;
&lt;li&gt;useEffect(() =&amp;gt; { ... }, [value]);
Runs on mount and whenever value changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Example:&lt;/em&gt;&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;import React, { useEffect, useState } from 'react';

export default function UseEffectHook() {
  const [count, setCount] = useState(0);
  const [color, setColor] = useState("green");

  // Runs on mount and whenever count or color changes
  useEffect(() =&amp;gt; {
    document.title = `Count: ${count} - Color: ${color}`;
  }, [count, color]);

  const incrementCount = () =&amp;gt; setCount(count + 1);
  const decrementCount = () =&amp;gt; setCount(count - 1);
  const toggleColor = () =&amp;gt; setColor(color === "green" ? "red" : "green");

  return (
    &amp;lt;&amp;gt;
      &amp;lt;p style={{ color }}&amp;gt;{`Count: ${count}`}&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={incrementCount}&amp;gt;Add&amp;lt;/button&amp;gt;
      &amp;lt;button onClick={decrementCount}&amp;gt;Subtract&amp;lt;/button&amp;gt;
      &amp;lt;button onClick={toggleColor}&amp;gt;Change Color&amp;lt;/button&amp;gt;
    &amp;lt;/&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use Cases of useEffect:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Event Listeners: Add/remove listeners (e.g., window.addEventListener).&lt;/li&gt;
&lt;li&gt;Fetching Data: Fetch API data when a component mounts or state changes.&lt;/li&gt;
&lt;li&gt;DOM Updates: Update document.title or other DOM properties.&lt;/li&gt;
&lt;li&gt;Cleanups: Handle cleanup tasks like unsubscribing from listeners.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Cleanup Example:&lt;/em&gt;&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;useEffect(() =&amp;gt; {
  const timer = setInterval(() =&amp;gt; console.log('Running...'), 1000);

  return () =&amp;gt; {
    clearInterval(timer); // Cleanup on unmount
  };
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State in Functional Components: Use useState for state variables.&lt;/li&gt;
&lt;li&gt;Side Effects: Use useEffect for anything that interacts with the outside world or reacts to changes in state/props.&lt;/li&gt;
&lt;li&gt;Dependency Array: Always specify the dependency array to avoid unnecessary renders or infinite loops.&lt;/li&gt;
&lt;li&gt;Cleanups: Always clean up subscriptions, intervals, or listeners in useEffect.
With useState and useEffect, building React applications becomes easier and more intuitive. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Day after day. &lt;br&gt;
Understanding upon understanding.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>mobile</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 24</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Mon, 23 Dec 2024 22:54:47 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-24-227e</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-24-227e</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Event Handling in React&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What Are Events in React?&lt;/strong&gt;&lt;br&gt;
Events are user or system actions (e.g., clicking a button, typing in a field, hovering over an element, etc.). React uses &lt;em&gt;synthetic events&lt;/em&gt;, a cross-browser wrapper around the browser’s native events, ensuring consistency and compatibility across different browsers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. How Do We Handle Events in React?&lt;/strong&gt;&lt;br&gt;
Event handling in React involves defining a &lt;code&gt;function&lt;/code&gt; &lt;code&gt;(event handler)&lt;/code&gt; that gets executed when the event occurs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Example Syntax:&lt;/em&gt;&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;function handleEvent() {
  console.log('Event handled!');
}

return &amp;lt;button onClick={handleEvent}&amp;gt;Click Me&amp;lt;/button&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;onClick is the event name.&lt;/li&gt;
&lt;li&gt;handleEvent is the function executed when the button is clicked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Key Points to Remember&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event Names: Use camelCase (e.g., onClick, onChange).&lt;/li&gt;
&lt;li&gt;Pass Function Reference: Do not invoke the function directly.&lt;/li&gt;
&lt;li&gt;✅ onClick={handleEvent}&lt;/li&gt;
&lt;li&gt;❌ onClick={handleEvent()}&lt;/li&gt;
&lt;li&gt;Event handlers can be defined inside or outside the component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Common Events in React&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onClick&lt;/code&gt;: Clicking a button&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onChange&lt;/code&gt;: Typing in an input field&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onSubmit&lt;/code&gt;: Submitting a form&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onMouseEnter&lt;/code&gt;: Hovering over an element&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onFocus&lt;/code&gt;: Focusing on an input field&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Example with Multiple Events&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Student.jsx:&lt;/em&gt;&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;import PropTypes from 'prop-types';

export default function Student(props) {
  // Event Handlers
  function handleClick() {
    alert('Button clicked');
  }

  function handleMouseEnter() {
    console.log('Mouse entered');
  }

  function handleInputChange(event) {
    console.log('Input value:', event.target.value);
  }

  return (
    &amp;lt;div className="student" onMouseEnter={handleMouseEnter}&amp;gt;
      &amp;lt;p&amp;gt;Name: {props.name}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Age: {props.age}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Student: {props.isStudent ? 'Yes' : 'No'}&amp;lt;/p&amp;gt;
      &amp;lt;input type="text" placeholder="Type something..." onChange={handleInputChange} /&amp;gt;
      &amp;lt;button onClick={handleClick}&amp;gt;Click Me&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

// PropTypes
Student.propTypes = {
  name: PropTypes.string,
  age: PropTypes.number,
  isStudent: PropTypes.bool,
};

// DefaultProps
Student.defaultProps = {
  name: 'Guest',
  age: 0,
  isStudent: false,
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. What's Happening Here?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;handleClick&lt;/code&gt;: Displays an alert when the button is clicked.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;handleMouseEnter&lt;/code&gt;: Logs a message to the console when the mouse enters the div.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;handleInputChange&lt;/code&gt;: Logs the text typed in the input field.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Accessing Event Information&lt;/strong&gt;&lt;br&gt;
React automatically passes the event object to the handler.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleClick(event) {
  console.log(event.target); // Logs the element that triggered the event
}

return &amp;lt;button onClick={handleClick}&amp;gt;Click Me&amp;lt;/button&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Inline Event Handlers &lt;code&gt;(Optional)&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
You can define event handlers directly in JSX:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button onClick={() =&amp;gt; console.log('Clicked!')}&amp;gt;Click Me&amp;lt;/button&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why Avoid Inline Functions?&lt;/strong&gt;&lt;br&gt;
They create a new function instance every time the component renders, which can impact performance. Use them sparingly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Binding this in Class Components&lt;/strong&gt;&lt;br&gt;
In class components, bind this to access the component’s context in event handlers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class App extends React.Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }

  handleClick() {
    console.log('Button clicked!');
  }

  render() {
    return &amp;lt;button onClick={this.handleClick}&amp;gt;Click Me&amp;lt;/button&amp;gt;;
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;10. Passing Arguments to Event Handlers&lt;/strong&gt;&lt;br&gt;
To pass arguments, use an inline arrow function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleClick(name) {
  alert(`Hello, ${name}!`);
}

return &amp;lt;button onClick={() =&amp;gt; handleClick('Ayoola')}&amp;gt;Click Me&amp;lt;/button&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Key Takeaways&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;React simplifies event handling with synthetic events for cross-browser compatibility.&lt;/li&gt;
&lt;li&gt;Always pass a function reference to event handlers.&lt;/li&gt;
&lt;li&gt;Use event objects to access detailed information about the event.&lt;/li&gt;
&lt;li&gt;Use inline functions sparingly for performance reasons.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;React event handling is fun and powerful! 🎉&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>mobile</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 23</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Sat, 21 Dec 2024 21:46:58 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-23-41k2</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-23-41k2</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Props and State&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PROPS&lt;/strong&gt;&lt;br&gt;
Props, short for &lt;em&gt;properties&lt;/em&gt;, are &lt;code&gt;read-only&lt;/code&gt; and &lt;code&gt;immutable data&lt;/code&gt; passed from parent to child components. They are mainly used to transfer data between components and ensure reusability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features of Props&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read-Only: Cannot be modified by the child component.&lt;/li&gt;
&lt;li&gt;Used in Functional and Class Components.&lt;/li&gt;
&lt;li&gt;PropTypes: Ensures props are of the correct data type during development.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age: PropTypes.number; // Throws a warning if a non-number is passed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;4.DefaultProps: Provides default values for props when none are passed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: "Guest"; // Default value for the name prop.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Example&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Student.jsx&lt;/em&gt;&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;import PropTypes from 'prop-types';

export default function Student(props) {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;Name: {props.name}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Age: {props.age}&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Student: {props.isStudent ? 'Yes' : 'No'}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

// PropTypes
Student.propTypes = {
  name: PropTypes.string,
  age: PropTypes.number,
  isStudent: PropTypes.bool,
};

// DefaultProps
Student.defaultProps = {
  name: 'Guest',
  age: 0,
  isStudent: false,
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STATE&lt;/strong&gt;&lt;br&gt;
State is an object within a component that holds dynamic values which can change over time. States are mutable and are generally used for user interactions and events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features of State&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can only be used in Class Components (in older React).&lt;/li&gt;
&lt;li&gt;Mutable: Updated using this.setState().&lt;/li&gt;
&lt;li&gt;Tracks dynamic data such as user inputs or real-time responses.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;App.jsx Implementation&lt;/strong&gt;&lt;br&gt;
Props are passed from the App component to the Student component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;App.jsx&lt;/em&gt;&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;import React from 'react';
import Student from './Student';

export default function App() {
  return (
    &amp;lt;&amp;gt;
      &amp;lt;Student name="Damilare" age={30} isStudent={true} /&amp;gt;
      &amp;lt;Student name="Feyisayo" age={31} isStudent={true} /&amp;gt;
      &amp;lt;Student name="Inioluwa" age={4} isStudent={true} /&amp;gt;
      &amp;lt;Student name="Iteoluwa" age={1} isStudent={false} /&amp;gt;
      &amp;lt;Student /&amp;gt; {/* Uses defaultProps */}
      &amp;lt;Student name="Bright" /&amp;gt; {/* Partial DefaultProps */}
    &amp;lt;/&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rendering in DOM&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;index.js&lt;/em&gt;&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;import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.jsx';

createRoot(document.getElementById('root')).render(
  &amp;lt;React.StrictMode&amp;gt;
    &amp;lt;App /&amp;gt;
  &amp;lt;/React.StrictMode&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Props: Immutable, passed from parent to child, and used for reusability.&lt;/li&gt;
&lt;li&gt;State: Mutable, manages dynamic behavior and is updated with this.setState().&lt;/li&gt;
&lt;li&gt;In modern React, hooks like useState make functional components equally capable of managing states, eliminating the need for class components.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>programming</category>
      <category>deedoth</category>
    </item>
    <item>
      <title>My React Journey: Day 22</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Thu, 19 Dec 2024 23:09:41 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-22-4p57</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-22-4p57</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;React Components (Functional vs. Class-Based)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Functional Components&lt;/strong&gt;&lt;br&gt;
A functional component is a JavaScript function that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepts input through props and returns HTML (JSX).&lt;/li&gt;
&lt;li&gt;Simplifies development by focusing only on presenting UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example of Functional Component:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Greet.jsx&lt;/em&gt;&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;function Greet() {
    return &amp;lt;h1&amp;gt;Hello Damilare&amp;lt;/h1&amp;gt;;
}

export default Greet;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;App.jsx&lt;/em&gt;&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;import React from "react";
import Greet from "./Components/Greet.jsx";

function App() {
    return (
        &amp;lt;div&amp;gt;
            &amp;lt;Greet /&amp;gt;
        &amp;lt;/div&amp;gt;
    );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Class Components&lt;/strong&gt;&lt;br&gt;
A class component is a JavaScript class that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepts input through props and maintains internal, private state.&lt;/li&gt;
&lt;li&gt;Contains a render() method that returns HTML (JSX).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example of Class Component:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Welcome.jsx&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from "react";

class Welcome extends Component {
    render() {
        return &amp;lt;h1&amp;gt;Class Component&amp;lt;/h1&amp;gt;;
    }
}

export default Welcome;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Usage in App.jsx:&lt;/em&gt;&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;import React from "react";
import Welcome from "./Components/Welcome.jsx";

function App() {
    return (
        &amp;lt;div&amp;gt;
            &amp;lt;Welcome /&amp;gt;
        &amp;lt;/div&amp;gt;
    );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Comparison: &lt;code&gt;Functional&lt;/code&gt; vs. &lt;code&gt;Class Components&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functional Components&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript function that returns JSX.&lt;/li&gt;
&lt;li&gt;Stateless by default; uses hooks (e.g., useState, useEffect) for state.&lt;/li&gt;
&lt;li&gt;Simple and ideal for UI-focused logic.&lt;/li&gt;
&lt;li&gt;Keyword 'this'    Not required.&lt;/li&gt;
&lt;li&gt;Lightweight Performance and optimized in modern React.&lt;/li&gt;
&lt;li&gt;Great for reusable/presentational components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Class Components&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript class that extends Component.&lt;/li&gt;
&lt;li&gt;Can manage internal state without hooks.&lt;/li&gt;
&lt;li&gt;Best suited for complex logic or stateful UI.&lt;/li&gt;
&lt;li&gt;Requires this for referencing properties/methods.&lt;/li&gt;
&lt;li&gt;Heavier and less preferred in modern React.&lt;/li&gt;
&lt;li&gt;More suited for smart/container components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages of Each Type&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Functional Components&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easier to write and understand.&lt;/li&gt;
&lt;li&gt;No need to deal with this keyword.&lt;/li&gt;
&lt;li&gt;Perfect for components that don't require state management.&lt;/li&gt;
&lt;li&gt;More concise and easier to test.&lt;/li&gt;
&lt;li&gt;With React Hooks, functional components can now handle state and side effects, bridging the gap with class components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Class Components&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can maintain private internal state.&lt;/li&gt;
&lt;li&gt;Useful for managing complex logic and component lifecycles.&lt;/li&gt;
&lt;li&gt;Best for older React projects that don't yet use hooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Should You Use Functional or Class Components?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In modern React (post v16.8), functional components are the preferred choice because:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;React Hooks (like useState and useEffect) have made functional components equally powerful for state and lifecycle management.&lt;/li&gt;
&lt;li&gt;Functional components are easier to read, write, and debug.&lt;/li&gt;
&lt;li&gt;They provide better performance, especially in rendering.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Class components are still valid but are mainly used in older projects &lt;br&gt;
or for backward compatibility.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaway:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use functional components whenever possible, especially in new projects.&lt;/li&gt;
&lt;li&gt;Only resort to class components if you're working with legacy code or need specific features unavailable in functional components (rarely the case now).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;code&gt;Progress&lt;/code&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>mobile</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>My React Journey: Day 20</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Wed, 18 Dec 2024 10:09:16 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-20-jnc</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-20-jnc</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Budget Tracker Project&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Today, I worked on a project titled &lt;em&gt;Budget Tracker&lt;/em&gt;. The goal of this project was to apply previously learned concepts in a practical and functional way. Here's an overview of the concepts I implemented and how they enhanced my skills:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concepts Learned and Applied&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.HTML Structure and Semantics&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I used a semantic and well-structured HTML layout for the budget tracker, ensuring clarity and easy maintenance. For instance, the &lt;code&gt;table&lt;/code&gt; element was used to organize budget entries, and input fields were added for data collection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.CSS for Styling&lt;/strong&gt;&lt;br&gt;
Learned to style the project for both functionality and aesthetics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used classes like .budget-tracker, .input, and .delete-entry to design and structure the UI.&lt;/li&gt;
&lt;li&gt;Focused on responsive design principles, ensuring the tracker works across different screen sizes.&lt;/li&gt;
&lt;li&gt;Added hover effects for buttons like .delete-entry to improve interactivity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.JavaScript Modules&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I modularized my JavaScript by creating a separate BudgetTracker.js class. This improved code reusability and separation of concerns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.Local Storage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I implemented Local Storage to persist budget entries across sessions. Users can reload the app without losing their data:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localStorage.setItem("budget-tracker-entries-dev", JSON.stringify(data));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5.Dynamic DOM Manipulation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamically created and updated rows in the budget table using JavaScript:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.root.querySelector(".entries").insertAdjacentHTML("beforeend", BudgetTracker.entryHtml());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6.Event Handling&lt;/strong&gt;&lt;br&gt;
I used event listeners to make the app interactive. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clicking the "New Entry" button adds a new row.&lt;/li&gt;
&lt;li&gt;Clicking the "Delete" button removes a row.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;row.querySelector(".delete-entry").addEventListener("click", e =&amp;gt; {
    this.onDeleteEntryBtcClick(e);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7.Data Validation and Formatting&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Applied logic to calculate the total income or expenses and displayed it in the appropriate format using Intl.NumberFormat:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const totalFormatted = new Intl.NumberFormat("en-US", {
    style: "currency",
    currency: "USD"
}).format(total);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8.Version Control and Debugging&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used browser dev tools to debug errors and inspect the behavior of dynamic components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Project Outcomes&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This project gave me a deeper understanding of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designing user-friendly interfaces with HTML and CSS.&lt;/li&gt;
&lt;li&gt;Integrating JavaScript logic to handle data dynamically.&lt;/li&gt;
&lt;li&gt;The importance of code modularity for scaling projects.&lt;/li&gt;
&lt;li&gt;Using Local Storage to maintain state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project also sharpened my &lt;em&gt;problem-solving skills&lt;/em&gt;, as I faced challenges like handling empty input fields and ensuring accurate calculations, etc.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The tracker consists of input fields for date, description, type, and amount, with a dynamic summary section displaying the total balance.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This project reinforced my confidence in building real-world applications! 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to dive into React Native&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>mobile</category>
      <category>reactnative</category>
      <category>oop</category>
    </item>
    <item>
      <title>My React Journey: Day 19</title>
      <dc:creator>Ayoola Damilare</dc:creator>
      <pubDate>Mon, 16 Dec 2024 18:08:56 +0000</pubDate>
      <link>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-19-1nla</link>
      <guid>https://dev.to/ayoola_damilare_212d5bde0/my-react-journey-day-19-1nla</guid>
      <description>&lt;h2&gt;
  
  
  Practice with JSON APIs and Mock Servers
&lt;/h2&gt;

&lt;p&gt;Working with json-server is a great way to simulate a backend server and practice API interactions like &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is json-server&lt;/strong&gt;?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;em&gt;tool&lt;/em&gt; that allows you to &lt;em&gt;quickly&lt;/em&gt; create a mock server to work with a &lt;code&gt;JSON&lt;/code&gt; &lt;code&gt;database&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ideal for prototyping and testing APIs without needing a fully functional backend.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup and Installation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Prerequisite: Node.js&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure Node.js is installed on your system. Verify using:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Install json-server&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install globally using npm:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g json-server@0.17.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to Use json-server
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Start the Server&lt;/strong&gt;&lt;br&gt;
Create a &lt;code&gt;db.json&lt;/code&gt; file in your working directory with some initial data. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "posts": [
    { "id": 1, "title": "First Post", "content": "Hello World!" },
    { "id": 2, "title": "Second Post", "content": "Learning JSON-Server" }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start the server and watch for changes in the db.json file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;json-server --watch db.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;By default, the server will run at &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Explore Endpoints&lt;/strong&gt;&lt;br&gt;
The server automatically creates RESTful endpoints for each collection in db.json:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET /posts&lt;/code&gt; → Fetch all posts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /posts/1&lt;/code&gt; → Fetch post with ID 1&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /posts&lt;/code&gt; → Add a new post&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PUT /posts/1&lt;/code&gt; → Replace the entire post with ID 1&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PATCH /posts/1&lt;/code&gt; → Update specific fields in the post with ID 1&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DELETE /posts/1&lt;/code&gt; → Delete the post with ID 1&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Using Postman
&lt;/h2&gt;

&lt;p&gt;Postman is a tool for making &lt;em&gt;HTTP requests&lt;/em&gt; to test &lt;em&gt;APIs&lt;/em&gt;. Here’s how to perform each operation with Postman:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. GET (Fetch Data)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request Type: GET&lt;/li&gt;
&lt;li&gt;URL: &lt;a href="http://localhost:3000/posts" rel="noopener noreferrer"&gt;http://localhost:3000/posts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Fetches the list of posts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. POST (Add New Data)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request Type: POST&lt;/li&gt;
&lt;li&gt;URL: &lt;a href="http://localhost:3000/posts" rel="noopener noreferrer"&gt;http://localhost:3000/posts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Headers: Content-Type: application/json&lt;/li&gt;
&lt;li&gt;Body (JSON):
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "id": 3,
  "title": "New Post",
  "content": "This is a new post"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Adds a new post to the posts collection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. PUT (Replace Entire Resource)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request Type: PUT&lt;/li&gt;
&lt;li&gt;URL: &lt;a href="http://localhost:3000/posts/2" rel="noopener noreferrer"&gt;http://localhost:3000/posts/2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Headers: Content-Type: application/json&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Body (JSON):&lt;br&gt;
&lt;code&gt;{&lt;br&gt;
"title": "Updated Title"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Result: Replaces the entire resource with the provided data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Before:&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;{
  "id": 2,
  "title": "Second Post",
  "content": "Learning JSON-Server"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&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;{
  "title": "Updated Title"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. PATCH (Update Specific Fields)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request Type: PATCH&lt;/li&gt;
&lt;li&gt;URL: &lt;a href="http://localhost:3000/posts/1" rel="noopener noreferrer"&gt;http://localhost:3000/posts/1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Headers: Content-Type: application/json&lt;/li&gt;
&lt;li&gt;Body (JSON):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "content": "Updated Content"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Updates only the specified field in the resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&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;{
  "id": 1,
  "title": "First Post",
  "content": "Hello World!"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&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;{
  "id": 1,
  "title": "First Post",
  "content": "Updated Content"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. DELETE (Remove Data)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request Type: DELETE&lt;/li&gt;
&lt;li&gt;URL: &lt;a href="http://localhost:3000/posts/1" rel="noopener noreferrer"&gt;http://localhost:3000/posts/1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Deletes the post with ID 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Differences Between &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;PATCH&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PUT&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replaces the entire resource. &lt;/li&gt;
&lt;li&gt;Omits any fields not included in the body.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;PATCH&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updates only specified fields.&lt;/li&gt;
&lt;li&gt;Retains fields not mentioned in the body.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What I Learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installed and used json-server to create a mock API server.&lt;/li&gt;
&lt;li&gt;Practiced basic API operations: GET, POST, PUT, PATCH, DELETE.&lt;/li&gt;
&lt;li&gt;Understood the difference between PUT and PATCH.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Day 19 Crushed.&lt;/p&gt;

</description>
      <category>postman</category>
      <category>json</category>
      <category>mobile</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
