<?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: Suzana Melo</title>
    <description>The latest articles on DEV Community by Suzana Melo (@suzanamelo).</description>
    <link>https://dev.to/suzanamelo</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%2F458400%2F21154524-62a2-4720-9649-692beffaf1bc.jpg</url>
      <title>DEV Community: Suzana Melo</title>
      <link>https://dev.to/suzanamelo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suzanamelo"/>
    <language>en</language>
    <item>
      <title>How to get started with AWS (for absolute beginners)</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Mon, 03 Feb 2025 21:31:34 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-to-get-started-with-aws-for-absolute-beginners-3m7d</link>
      <guid>https://dev.to/aws-builders/how-to-get-started-with-aws-for-absolute-beginners-3m7d</guid>
      <description>&lt;p&gt;Who hasn’t felt a stomach full of butterflies before diving into something completely new? 🦋&lt;br&gt;
That was me when I realized I needed to learn about Cloud Computing to excel in my career, without a clue where to start.&lt;/p&gt;

&lt;p&gt;If you're in the same boat, an absolute beginner like I was when I first started, I strongly recommend taking a quick detour to this article first: &lt;a href="https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe"&gt;Cloud Computing: What it is and why should tech beginners learn it?&lt;/a&gt;. It’ll give you some background on why Cloud Computing is worth your time.&lt;/p&gt;

&lt;p&gt;Back already? Or just eager to jump in? Awesome! Grab a seat, fasten your seatbelt, and let’s fly into the Cloud! ⛅️&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get started? 🤔
&lt;/h2&gt;

&lt;p&gt;With so many paths to the Cloud, it's easy to feel overwhelmed. But trust me, it doesn’t have to be. The first lesson I learned through my learning journey, and that I recommend to you, is not to skip steps. Building a solid foundation will give you the base you need to go higher.&lt;/p&gt;

&lt;p&gt;As an absolute beginner, I lacked background and struggled to understand key definitions, products, and services. It was when the Cloud Essentials course on the AWS Skill Builder platform came in handy. 🥰&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Skill Builder ⚒️
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnk1mcvppu08qnjy2v6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnk1mcvppu08qnjy2v6w.png" alt=" " width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Skill Builder is part of AWS Training and Certification, offering a range of courses across various cloud specialties. While many labs and trainings are accessible by paying a monthly subscription of $29 USD, thankfully, the Cloud Foundations resources are completely free. 🙌🏻&lt;/p&gt;

&lt;p&gt;To sign in and access the AWS Skill Builder resources, it is recommended by AWS that you create an &lt;strong&gt;AWS Builder ID&lt;/strong&gt;, a free AWS personal profile that allows access to specific tools and services. You can read more about this credential &lt;a href="https://docs.aws.amazon.com/signin/latest/userguide/sign-in-aws_builder_id.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once signed in to the AWS Skill Build, you can explore courses tailored to different learning pathways: Cloud Role, Product Domain, Certification preparation exams, and many more. But for now, let’s focus only on the Cloud Essentials Badge—your starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud Essentials Badge 🥇
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx3w82c5iwn9elzbz695x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx3w82c5iwn9elzbz695x.png" alt=" " width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cloud Essentials Badge package includes five free, online, and self-paced courses covering foundational Cloud knowledge: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Job Roles in the Cloud&lt;/li&gt;
&lt;li&gt;AWS Cloud Practitioner Essentials&lt;/li&gt;
&lt;li&gt;Getting Started with Cloud Acquisition&lt;/li&gt;
&lt;li&gt;AWS Billing and Cost Management&lt;/li&gt;
&lt;li&gt;AWS Foundations: Getting Started with AWS Cloud Essentials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AWS Cloud Practitioner Essentials module, for example, provides an easy-to-digest introduction to Cloud infrastructure and services, using a coffee shop analogy to explain key concepts. The analogies between coffee shop operations and AWS services were a life-changing experience for me in understanding the new content.&lt;/p&gt;

&lt;p&gt;AWS Billing and Cost Management is another crucial module that includes all the essential concepts needed to understand how AWS pricing works, including budgeting, cost optimization, and payment tools.&lt;/p&gt;

&lt;p&gt;The package in the Cloud Essentials Badge also includes an assessment to earn the Cloud Essentials Badge, which you can proudly display on LinkedIn or your CV. 🏅&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Cloud Quest 🎮
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgadq1ad80tv8nzhh63p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgadq1ad80tv8nzhh63p.png" alt=" " width="644" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you have all the theory that you need, why not practice with real case scenarios and problems to solve?&lt;/p&gt;

&lt;p&gt;AWS Cloud Quest is a 3D role-playing game to help you build practical AWS Cloud skills in an interactive and fun way. AWS Cloud Quest offers different tracks tailored for a variety of Cloud roles, but for beginners, start with the Cloud Practitioner role. The goal is to solve real-life Cloud challenges and gain hands-on experience while exploring AWS services.&lt;/p&gt;

&lt;p&gt;Best part? It’s free and rewards you with another badge once you've completed all role assignments. One more achievement for your CV! 🔥&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Cloud Certification 👩🏻‍💻
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucv1c9mz7ikqfpxas5oc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucv1c9mz7ikqfpxas5oc.jpeg" alt=" " width="750" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By this stage, you’ll be on your way to your first AWS Cloud Certification, the AWS Cloud Practitioner. This cert validates your foundational Cloud knowledge and opens doors for deeper learning in specialized AWS domains.&lt;/p&gt;

&lt;p&gt;📌 Want to know how I prepared for my first Cloud certification? &lt;br&gt;
I shared my study tips and experience in this article: &lt;a href="https://dev.to/suzanamelomoraes/how-i-prepared-myself-for-the-aws-cloud-practitioner-certificate-5a1f"&gt;How I Prepared for the AWS Cloud Practitioner Certificate&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;📌 In my GitHub repository, you can find more resources to start your journey in this list: &lt;a href="https://github.com/suzanamelomoraes/AWSfree" rel="noopener noreferrer"&gt;Free AWS training courses&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary 📝
&lt;/h2&gt;

&lt;p&gt;After reading this article, I hope there is no longer any reason to feel your stomach full of butterflies about starting your Cloud journey! 🦋&lt;/p&gt;

&lt;p&gt;Now you know you can learn AWS for free and online from wherever you are, study at your own pace, and earn valuable badges along the way. Plus, you’ll build a solid foundation for your first AWS certification! ✨&lt;/p&gt;

&lt;p&gt;Happy learning and to infinity and beyond! ❤️☁️🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://skillbuilder.aws/" rel="noopener noreferrer"&gt;AWS Skill Builder&lt;/a&gt;&lt;br&gt;
Cloud Essentials - &lt;a href="https://explore.skillbuilder.aws/learn/learning-plans/82/cloud-essentials-knowledge-badge-readiness-path" rel="noopener noreferrer"&gt;Knowledge Badge Readiness Path&lt;/a&gt;&lt;br&gt;
&lt;a href="https://aws.amazon.com/training/digital/aws-cloud-quest/" rel="noopener noreferrer"&gt;AWS Cloud Quest&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/suzanamelomoraes/AWSfree" rel="noopener noreferrer"&gt;Free AWS training courses&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Related articles:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe"&gt;Cloud Computing: What it is and why tech beginners should learn it?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/suzanamelomoraes/how-i-prepared-myself-for-the-aws-cloud-practitioner-certificate-5a1f"&gt;How I Prepared for the AWS Cloud Practitioner Certificate&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>cloudcomputing</category>
      <category>career</category>
    </item>
    <item>
      <title>Upskill and Accelerate Your Career by Volunteering</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Wed, 16 Oct 2024 08:46:47 +0000</pubDate>
      <link>https://dev.to/suzanamelo/upskill-and-accelerate-your-career-by-volunteering-264l</link>
      <guid>https://dev.to/suzanamelo/upskill-and-accelerate-your-career-by-volunteering-264l</guid>
      <description>&lt;p&gt;When you think of volunteering, what is the first thing that comes to your mind? 🤔&lt;/p&gt;

&lt;p&gt;Many people think volunteering is tough, that they lack the knowledge, or that they just don’t have enough time. But here’s the thing: those are all myths. You can volunteer your time to support others in many different ways, and trust me, you have more than enough knowledge to do so. ✨&lt;/p&gt;

&lt;p&gt;Let’s talk about something we all wish we had more of: time. ⏳&lt;/p&gt;

&lt;p&gt;How often have you found yourself scrolling on social media or watching a TV show, only to realize that time flew by? And I am not saying you shouldn’t do it. Taking time for ourselves is essential. Go for a walk, read a book, watch a good movie, or why not? Do nothing at all. However, if you consider how much time you spend on things that aren’t super meaningful, you may find two or three hours a week to volunteer for something that matters to a lot of people.&lt;/p&gt;

&lt;p&gt;Volunteering isn’t new to me. I had loved this since I was a teenager when I helped up a non-profit organization by making soup for homeless people and pitching in wherever needed. After changing careers to the technology field after my 40s - without any tech background -I developed a real appreciation for those who stopped to help me along the way. I needed and still need help—a lot! So, now, I try to return the favor. Ah, here is an interesting detail: I am still a beginner.&lt;/p&gt;

&lt;p&gt;When I started helping other beginners, especially women like me with no tech background, I realized that you don’t need to be an expert to start sharing what you know. Each of us learns differently, and there’s always someone who could use your insights and guidance.&lt;/p&gt;

&lt;p&gt;📍 If you want to upskill and boost your growth, volunteering can be an incredible way to do it. I will give my 2 cents by listing three reasons to get started:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 - Build Your Technical Skills&lt;/strong&gt; 👩🏻‍💻&lt;br&gt;
Volunteering to teach or mentor forces you to brush up on your own knowledge. You often need to review concepts you didn’t remember or learn something new as you prepare content, answers, or explanations. Researching and/or organizing information can deepen your understanding of a topic.&lt;br&gt;
As I mentioned, you don’t need to be a guru. Just by sharing what you know, you’re helping someone else succeed on their journey.  It’s not about giving solutions or walking the path for them, but about facilitating their learning process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 - Strengthen Your People Skills&lt;/strong&gt; 🫶🏻&lt;br&gt;
People skills are crucial, and like any skills, they can be learned and developed. I can’t think of a better way to build your skills than volunteering to teach or mentor people. &lt;br&gt;
It will develop your ability to express your ideas and explain technical content in a way that’s easy to grasp. Communication skills are gold, whether you are being interviewed, collaborating in teams, discussing projects, or presenting solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3 - Experience Personal Growth&lt;/strong&gt; 🤩&lt;br&gt;
Volunteering exposes you to diverse life stories and challenges. You get to hear about others' struggles, failures, and successes, which can be incredibly inspiring. This exposure builds empathy, patience, resilience, and humility—qualities that enrich both your personal and professional life and make a difference wherever you go. We are all humans, after all.&lt;/p&gt;

&lt;p&gt;🙋🏻‍♀️ Interested in volunteering? Here’s where you can start:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mentoring&lt;/strong&gt; 💻&lt;/p&gt;

&lt;p&gt;If you are still a student, chances are there is some mentoring program in your school or university. Check out local Meetup groups in areas that interest you. There, you can make connections to offer mentoring and ask around about other mentoring opportunities for you to join. You can also post on LinkedIn to let others know you’re open to mentoring.&lt;br&gt;
Creating a Calendly account or using another scheduling platform is a valuable tool for managing your available time for mentoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Teaching&lt;/strong&gt; 👩🏻‍🏫&lt;/p&gt;

&lt;p&gt;Nonprofits are wonderful places to volunteer and help others develop new skills. Volunteers are usually very welcome. Check your city council’s website or simply Google nonprofit opportunities in your area. Once you’ve decided to volunteer, there’s nothing stopping you from finding the perfect fit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech community and content creation&lt;/strong&gt; 📝&lt;/p&gt;

&lt;p&gt;Tech meetups are excellent for networking, learning, and sharing knowledge. You can organize knowledge-sharing events or create content like talks and articles to volunteer your time and help others while you build confidence and technical knowledge as a bonus prize.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 I recommend starting from scratch—research, write, and organize your thoughts. Still, AI has infinite tools to support your content creation, so there is no shame in using it to review and refine your work. 🤖&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are just a few examples of how you can volunteer, but there are many other ways to give your time to help others. By doing so, you’re also fast-tracking your own growth. &lt;br&gt;
If you have other ideas for volunteering, share them in the comments. That way, you’re already starting to volunteer your time by helping others. &lt;br&gt;
For those who have followed me in this article until the end, what are you waiting for to start? ❤️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ly98j994vw5u0y7wx63.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ly98j994vw5u0y7wx63.jpg" alt=" " width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>ai</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Cloud Computing: What it is and why tech beginners should learn it?</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Tue, 24 Oct 2023 07:40:48 +0000</pubDate>
      <link>https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe</link>
      <guid>https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe</guid>
      <description>&lt;p&gt;Cloud is everywhere, and we often do not even notice it, but it's part of our lives, whether we are aware of it or not.&lt;br&gt;
Clearly, I'm not talking about an aerosol consisting of a visible mass of tiny liquid droplets, frozen crystals, or other particles suspended in the atmosphere of a planetary body.&lt;/p&gt;

&lt;p&gt;So, what is the Cloud?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhywlxro9nojeamvu92u.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhywlxro9nojeamvu92u.jpg" alt="Meteor" width="800" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine you are working on some critical files on your computer when a meteor breaks your window and smashes your laptop! &lt;br&gt;
Okay, maybe a meteor is too much, so let's change that to a golf ball. &lt;br&gt;
I sincerely hope that at this moment, you can think: "At least all my documents, photos, and files are stored in the Cloud". Maybe something like Google Drive, Dropbox, or iCloud. Am I right?&lt;br&gt;
If my wishes come true,  it means your stuff is saved in servers in the Cloud instead of your computer.&lt;br&gt;
When you upload your documents to tools like Google Drive or Dropbox, it is like having a hard drive that you can access anytime, even when connected to the Internet, and perform a backup of your files if something happens to your device, such as an unexpected meteor or a golf ball from the sky.&lt;br&gt;
Cloud refers to servers accessed over the Internet and other stuff, such as the software and databases that run on those servers.&lt;/p&gt;

&lt;h1&gt;
  
  
  Before the Cloud
&lt;/h1&gt;

&lt;p&gt;Having things running in the Cloud sounds very handy, huh? I can't imagine a world without tools like email and Google Drive. But can you imagine how the world was before the Cloud?&lt;br&gt;
Companies must have a physical space to host their servers on-premises, meaning they need to spend money to ensure they are secured and powered up, and have teams to care about the hardware and software. &lt;br&gt;
Well, there are situations nowadays when on-premises is the best solution for some companies. Still, when this is the case, they need to pay for the costs of the whole structure and are stuck with all of that, even when not using them.&lt;br&gt;
Accessing these shared resources in the Cloud without needing a physical structure opened the doors and created new possibilities for many small businesses. Something almost impossible to happen in the past.&lt;/p&gt;

&lt;h1&gt;
  
  
  Back in time for a bit
&lt;/h1&gt;

&lt;p&gt;The concept of sharing resources started in &lt;strong&gt;1950&lt;/strong&gt; when multiple users could access the same data storage layer and CPU power using large-scale mainframes with high-volume processing power.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fheupxdw0veo2dhzd22xk.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fheupxdw0veo2dhzd22xk.jpeg" alt="Large-scale mainframes in 1950" width="602" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;1970&lt;/strong&gt;, the Virtual Machine (VM) era started with mainframes having multiple virtual systems, or compute environments, on a single physical node/hardware. Using a VM, a user could host guest operating systems, such as Windows or Linux, that behaved like they had their own memory, CPU, and hard drives, even though these were shared resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp5mj2g94gba2nrw52me.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp5mj2g94gba2nrw52me.jpeg" alt="Mainframes in 1070" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cherry on top of the VMs was the hypervisor, also known as a virtual machine monitor or VMM. You can think of it as an orchestra conductor, a software that creates and runs virtual machines (VMs) and allows each host computer to support multiple guest VMs by virtually sharing its resources, such as memory and processing.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;1991&lt;/strong&gt;, the world started to change significantly with the creation of the World Wide Web, also known as the Web, WWW, or W3. Thanks to the WWW, users can now access public websites or pages on their local computers and other devices through the Internet. It was only a matter of time before VM concepts could also be accessed virtually.&lt;/p&gt;

&lt;h1&gt;
  
  
  Servers in the Cloud
&lt;/h1&gt;

&lt;p&gt;It didn't take too long for some companies to realize they could make Cloud benefits accessible to users who didn't have an abundance of physical servers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwpeiltr08cqiz1a35by.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwpeiltr08cqiz1a35by.png" alt="EC2 launched in 1996" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;2006&lt;/strong&gt;, Amazon Web Services launched the Amazon Elastic Compute Cloud (EC2), making accessible to anyone a service that lets you run virtual servers in the Cloud with the bonus of having a secure and resizable compute capacity for virtually any workload.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05o6ijnp9zd7bsj5ktul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05o6ijnp9zd7bsj5ktul.png" alt=" " width="800" height="380"&gt;&lt;/a&gt;&lt;br&gt;
By using an EC2, you can access your resources virtually at any time. You can choose the operating system (Windows, Linux, IOS) you want and what you want to run on your server (internal business applications, web apps, and databases). You can also define the size and configure them to scale up and down depending on your demand. You control the network and security (public or private access), who can access what, and the type (Memory, Storage, etc.).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqq56iuqm4l308vxr8zgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqq56iuqm4l308vxr8zgt.png" alt="History of Cloud Computing" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Soon after, other companies launched their Cloud services, such as Google Compute Engine, Azure Virtual Machines, Elastic Compute Service (ECS), etc. Since then, users can run and control the configuration of their own servers from anywhere without needing to buy and maintain a physical data center.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cloud Computing definition
&lt;/h1&gt;

&lt;p&gt;Now that we have a better understanding of how it all started, let's review some key definitions of cloud computing to see how they become more clear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wikipedia&lt;/strong&gt; - Cloud computing is the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Large Clouds often have functions distributed over multiple locations, each of which is a data center. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS&lt;/strong&gt; - Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis from a Cloud provider like Amazon Web Services (AWS).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NIST&lt;/strong&gt; - Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction. &lt;/p&gt;

&lt;h1&gt;
  
  
  Why Cloud Computing?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fznjowckdr79il7phnp2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fznjowckdr79il7phnp2e.png" alt="Cloud Computing Benefits" width="600" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Without Cloud Computing, businesses need to pay for servers and hardware in advance and start with more capacity than they need, wasting money. If the demand grows too fast, and they don't cope accordingly, they can suffer performance issues or failures. I even mentioned all the costs associated with managing facilities, hardware, and infrastructure.&lt;/p&gt;

&lt;p&gt;Cloud Computing services allow you to choose the deployment model that best suits your business needs. There are different ways to set up your Cloud environment depending on your goals. &lt;br&gt;
&lt;strong&gt;Public Clouds&lt;/strong&gt; are open to anyone and easy to access from anywhere online — great for scalability and cost efficiency. &lt;br&gt;
&lt;strong&gt;Private Clouds&lt;/strong&gt;, on the other hand, give you full control over your resources in a dedicated environment, perfect for businesses with strict security or compliance needs. &lt;br&gt;
Some companies go for a &lt;strong&gt;Hybrid Cloud&lt;/strong&gt;, mixing the best of both worlds — keeping sensitive data on-premises while still enjoying the flexibility of the public Cloud.&lt;br&gt;
And finally, there’s the &lt;strong&gt;Community Cloud&lt;/strong&gt;, where organizations with similar interests or requirements, like universities or government agencies, share resources in a secure space.&lt;/p&gt;

&lt;p&gt;One thing all of them must have in common: Be self-service and on-demand. You pay only for what you use and use only what you need.&lt;/p&gt;

&lt;p&gt;I know there is a lot of information to cover, but now we can better understand how versatile, accessible, and easy to adopt Cloud Computing is. Cloud technology's agility and flexibility enable new ways of working, operating, and doing business.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Growth&lt;/strong&gt;📈&lt;/p&gt;

&lt;p&gt;For these and many more reasons, Cloud Computing is irreversible and will continue to grow.&lt;/p&gt;

&lt;p&gt;According to research published on websites such as CloudZero, Zippia, and Earthweb, 94% of all companies worldwide utilize cloud computing in their operations.&lt;br&gt;
This high level of adoption is not a surprise. With Cloud Computing, resources are available in minutes, meaning companies can perform, scale, and respond to new market developments much more rapidly.&lt;br&gt;
The impact is also financial. &lt;br&gt;
Another survey by Deloitte showed that small and medium businesses that adopted Cloud computing made 21% more profit and grew 26% faster. Accenture revealed that moving workloads to the public Cloud led to Total Cost of Ownership (TCO) savings of 30-40%.&lt;br&gt;
Statistics published by Spacelift show that by 2026, the Cloud Computing market is forecast to be worth $947.3 billion.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cloud Computing careers
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa70vay1jwzod1l2437x9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa70vay1jwzod1l2437x9.png" alt="Cloud Computing jobs" width="657" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The high level of Cloud Computing adoption also resulted in many Cloud-related jobs necessary to implement and maintain all those services working. Even though your job may not be specifically cloud-related, if you work for a company that has adopted cloud computing services, chances are you will have some contact with that. &lt;br&gt;
A full-stack developer working in a small start-up will likely handle some API Gateways and write some AWS Lambda functions as I needed to do (without previous knowledge about the Cloud). &lt;br&gt;
There are also other Cloud Computing roles I even heard about before starting to learn the Cloud, such as Cloud Consultant, Cloud Engineer, Cloud Support Engineer, Solutions Architect, and so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyjkv40jygkqswwcj2vi.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyjkv40jygkqswwcj2vi.jpeg" alt="Cloud to everyone" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The great news is the Cloud is for everyone! &lt;br&gt;
You don't need to wait to be a tech expert to start learning about the Cloud. Building a solid base and perhaps adding a foundational certification is a great way to begin upskilling and preparing yourself for the market. It can help you gain a general understanding of Cloud Computing before you decide which area to pursue.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary 📝
&lt;/h1&gt;

&lt;p&gt;Now, you know a bit more about what Cloud Computing is, how it started, and the advantages of adopting this powerful technology. The flexibility, versatility, security, and cost savings are just a few of the benefits that make Cloud Computing so attractive to a diverse range of businesses, and this is why this technology is irreversible.&lt;/p&gt;

&lt;p&gt;📌 Ready to take your first steps into this exciting area?&lt;br&gt;
Check out my article &lt;a href="https://dev.to/aws-builders/how-to-get-started-with-aws-for-absolute-beginners-3m7d"&gt;How to get started with AWS (for absolute beginners)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;📌 Want to know how I prepared for my first Cloud certification? &lt;br&gt;
I shared my study tips and experience in this article: &lt;a href="https://dev.to/suzanamelomoraes/how-i-prepared-myself-for-the-aws-cloud-practitioner-certificate-5a1f"&gt;How I Prepared for the AWS Cloud Practitioner Certificate&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;📌 In my GitHub repository, you can find more resources to start your journey in this list: &lt;a href="https://github.com/suzanamelomoraes/AWSfree" rel="noopener noreferrer"&gt;Free AWS training courses&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feedback and suggestions are always welcome. ❤️&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources:
&lt;/h2&gt;

&lt;p&gt;AWS - &lt;a href="https://aws.amazon.com/what-is-cloud-computing/" rel="noopener noreferrer"&gt;Cloud Computing&lt;/a&gt;&lt;br&gt;
National Institute of Standards and Technology - &lt;a href="https://csrc.nist.gov/pubs/sp/800/145/final" rel="noopener noreferrer"&gt;NIST&lt;/a&gt;&lt;br&gt;
AWS - &lt;a href="https://aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;EC2&lt;/a&gt;&lt;br&gt;
Wikipedia - &lt;a href="https://en.wikipedia.org/wiki/Cloud_computing" rel="noopener noreferrer"&gt;Cloud Computing&lt;/a&gt;&lt;br&gt;
Guru99 - &lt;a href="https://www.guru99.com/what-is-cloud-computing-with-example.html" rel="noopener noreferrer"&gt;Cloud Computing&lt;/a&gt;&lt;br&gt;
Cloudflare - &lt;a href="https://www.cloudflare.com/en-au/learning/cloud/what-is-the-cloud/" rel="noopener noreferrer"&gt;Cloud Computing&lt;/a&gt;&lt;br&gt;
Cloudzero - &lt;a href="https://www.Cloudzero.com/blog/Cloud-computing-statistics" rel="noopener noreferrer"&gt;Statistics&lt;/a&gt;&lt;br&gt;
Zippia - &lt;a href="https://www.zippia.com/advice/Cloud-adoption-statistics/" rel="noopener noreferrer"&gt;Statistics&lt;/a&gt;&lt;br&gt;
Spacelift - &lt;a href="https://spacelift.io/blog/cloud-computing-statistics" rel="noopener noreferrer"&gt;Statistics&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cloud</category>
      <category>aws</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>The challenge of “start” in Tech</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Thu, 21 Sep 2023 22:50:19 +0000</pubDate>
      <link>https://dev.to/suzanamelo/the-challenge-of-start-in-tech-2o8l</link>
      <guid>https://dev.to/suzanamelo/the-challenge-of-start-in-tech-2o8l</guid>
      <description>&lt;p&gt;Still buzzing about the fantastic discussion “Beyond the Code: Essential Skills for Success in Software Development”, I was invited to participate at the &lt;a href="https://www.devday.co.nz/" rel="noopener noreferrer"&gt;Dev Day Aotearoa&lt;/a&gt; 2023 conference a week ago.&lt;/p&gt;

&lt;p&gt;Incidentally, the message delivered, mainly to graduates and junior developers, was not so different from my speech at the Migrants in Tech meetup event last month. Both talks focused on a central point that both audiences are handling at that moment of their lives: the challenge of the “start”.&lt;/p&gt;

&lt;p&gt;The start phase is always challenging, especially as it is usually followed by uncertainty. It can be a new career, a new job, a new project, a new activity or a new relationship.&lt;br&gt;
I moved to New Zealand in 2014, and since then, I had many significant “starts”. Start learning English. Start cleaning different houses with different products than in my hometown. Start driving a van and deliver food on the streets of a new city. Start operating a checkout in a supermarket. Start learning a programming language with no tech background.&lt;/p&gt;

&lt;p&gt;Each time was as hard as any other start, but I also accumulated learnings to help me in the next one.&lt;br&gt;
I learned that I will never be 100% prepared for a new start, but I also learned to be comfortable with that.&lt;/p&gt;

&lt;p&gt;Here are some of the leanings that helped me to start a new career as a software developer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fundamentals are crucial - Build your foundations, prepare yourself and anticipate steps and knowledge as much as possible. It helps to handle uncertainty and build on top of what you already know.&lt;/li&gt;
&lt;li&gt;However, it’s important to remember that no one knows everything, nor do you need to - Be comfortable with that.&lt;/li&gt;
&lt;li&gt;Practice, practice, practice - Practice leads to perfection, but be kind to yourself. If you get only 1% better each day, you will be 365% better in one year.&lt;/li&gt;
&lt;li&gt;Find your genius zone to shine and stand out of the crowd - Which skill, area or knowledge are you most comfortable with? There are many ways to show your work and value, as no “one size fits all” exists. You can build projects and link them to your profile, contribute to open-source projects, or mentor others (there is always someone who knows less than you and needs your insights). You can write articles about your projects, learnings or research or, if you can, discuss or give talks about them in meetups. Tell it to your network, and post it on LinkedIn and other channels.&lt;/li&gt;
&lt;li&gt;Increase network - I already mentioned meetups, but I’m also including any other events you can make: conferences, workshops, webinars and job fairs. Use the opportunity provided by those events to connect with people, in person and online, and share what you are doing to them.&lt;/li&gt;
&lt;li&gt;Improve your communication skills - Practise asking questions and clearly explaining your ideas, challenges, and points of view (Don’t forget that people don't read minds). A great way to achieve it is to write down what you want to say and read it to yourself first. Don’t forget to ask for feedback and suggestions on where to improve next time.&lt;/li&gt;
&lt;li&gt;Have I said, "Ask questions"? - Curiosity and willingness to learn are crucial for growth. Be open-minded, and don’t hesitate to ask questions when necessary. It is likely that someone else already struggled in the past with the same problem you are struggling with now and already knows the answer that you spent hours looking for.&lt;/li&gt;
&lt;li&gt;Don’t undervalue your previous experience - They matter and can help you excel in your next job. All kinds of knowledge are valuable and transferable, especially soft skills. I prefer to call them “Human Skills” as, at the end of the day, we all are humans relating with each other in teams, groups or families.&lt;/li&gt;
&lt;li&gt;Compare yourself with you yesterday, not with others today - Take the time to look back and appreciate your growth because it is something to be proud of.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm an immigrant woman who moved countries, learned a new language, pursued a career in tech after my 40s and restarted many times. Learning software development is still hard, and I fight against impostor syndrome daily, but as I mentioned, there is always someone who knows less than you and needs your insights, and I'm sharing my learnings.&lt;/p&gt;

&lt;p&gt;I can't wait to hear yours! ❤️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article is also published on&lt;/em&gt; &lt;a href="https://www.linkedin.com/pulse/challenge-start-tech-suzana-melo-moraes%3FtrackingId=eXOg3ZZcTuifpbXUmzYeIw%253D%253D/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>techcareers</category>
      <category>beginners</category>
      <category>womenintech</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Tracking events effectively in Web Browsers with Mini Digital</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Fri, 18 Aug 2023 07:31:22 +0000</pubDate>
      <link>https://dev.to/suzanamelo/tracking-events-effectively-in-web-browsers-with-mini-digital-10gk</link>
      <guid>https://dev.to/suzanamelo/tracking-events-effectively-in-web-browsers-with-mini-digital-10gk</guid>
      <description>&lt;p&gt;Knowing your user's behaviour is life-changing for your product. It will give you insights to empower your product team to develop better solutions for your customers bringing benefits such as increasing fidelity and engagement and attracting new users.&lt;/p&gt;

&lt;p&gt;Mini Digital comes into the market by offering a lightweight and privacy-focused library for collecting event data for product analytics from your entire stack: websites, web apps, mobile, backend services and decentralised apps, including sub-domains.&lt;/p&gt;

&lt;p&gt;All in one solution. Bingo!&lt;/p&gt;

&lt;p&gt;However, a tool is useless if you don’t know how to use it correctly.&lt;/p&gt;

&lt;p&gt;Knowing how to track your data effectively is crucial for gaining the insights you need to plan and improve your products or marketing strategy.&lt;/p&gt;

&lt;p&gt;This article will cover how to effectively integrate Mini Digital into your web browser using the SDK for accurate and insightful product tracking and what places you need to be in mind in your codebase to send your event data properly and achieve the desired outcomes.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Onboarding&lt;/strong&gt; 📝
&lt;/h2&gt;

&lt;p&gt;For this article, let’s assume that the onboarding process has already happened with Mini Digital. This means you already have an account, and the Mini Digital team have set their configurations to receive the events from your domain and subdomains.&lt;/p&gt;

&lt;p&gt;If you are reading this article in the future, Mini Digital App will already be available, and the onboarding will be straightforward. Using the app, you can sign in, create your account and quickly set up your domains and subdomains.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;The Library&lt;/strong&gt; 📚
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/WunderbarNetwork/mini-digital-sdk-js" rel="noopener noreferrer"&gt;Mini Digital SDK&lt;/a&gt; is an open-source library built using TypeScript and the ESM module format, and it compiles to the ES2022 target. You can use it in Node.js or browser-based TypeScript/JavaScript projects (including frameworks like React or Vue). Backwards CommonJS compatibility is provided by the library.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Installation and use&lt;/strong&gt; 💻
&lt;/h2&gt;

&lt;p&gt;Based on the &lt;a href="https://docs.mini.digital/" rel="noopener noreferrer"&gt;Mini Digital Docs&lt;/a&gt;, there are two main ways to track an event using Mini Digital and send your event payload to the Mini Digital API endpoint: using the SDK or submitting the raw payload with the required fields from the schema to the Mini Digital endpoint by HTTP request. I will cover this last option in another article, but you can find all information you need in the &lt;a href="https://docs.mini.digital/event-tracking-integration/http-api.html" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, you must install the SDK using a package manager (either npm or yarn). To do that, run the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @wunderbar-network/mini-digital-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add @wunderbar-network/mini-digital-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next step is to import the SDK to your project, destructuring the AnalyticsEvent type and EventTrackingService module.&lt;/p&gt;

&lt;p&gt;If installed via a package manager, you can import it as so (TypeScript/ESM syntax):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;import &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;type &lt;/span&gt;AnalyticsEvent, EventTrackingService &lt;span class="o"&gt;}&lt;/span&gt; from &lt;span class="s2"&gt;"@wunderbar-network/mini-digital-sdk"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If referencing a file (either from the CDN or locally), you can import it as per the example below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;import &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;type &lt;/span&gt;AnalyticsEvent, EventTrackingService &lt;span class="o"&gt;}&lt;/span&gt; from &lt;span class="s2"&gt;"../lib/mini-digital-sdk.v1.3.esm.js"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you have the SDK ready to go, this is the moment to declare your events for tracking.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Declare and send events&lt;/strong&gt; 📤
&lt;/h2&gt;

&lt;p&gt;Once your initial set-up is done, it is time to think about what you want to track and, most importantly, where you will declare and send events to track the user behaviour you need.&lt;/p&gt;

&lt;p&gt;The Analytics Event for the Mini Digital API Server expects a schema containing fields with properties to be supplied by the SDK consumer.&lt;/p&gt;

&lt;p&gt;Mini Digital SDK provides pre-defined core schemas designed to keep your data consistent. Some are mandatory to keep the minimum information necessary for accurate tracking. There are also options for you to customise the data you want to send.&lt;/p&gt;

&lt;p&gt;You can find more about Mini Digital Core Schema Properties &lt;a href="https://docs.mini.digital/core-schema/properties.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I will cover all the aspects and properties of the schema in the upcoming articles. In this article, let’s focus on the minimum mandatory fields you must fulfil, especially the use cases and best places for each event category in your codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Mandatory properties&lt;/strong&gt; ✅
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;eventName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;home_page_viewed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;eventCategory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screen_view_event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;eventSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Website.MiniDigital.Router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;entityType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;home_page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;viewed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;anonymousUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;eventName&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is crucial information for you to send when tracking an event. This property is a string that refers to the event name you are tracking, e.g., account_created, crown_minted, screen_viewed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Mini Digital Docs recommends you define your eventName by using the object+action framework, where the object is the system or service that the user interacts with, e.g., button, screen or a data entity (account, image, payment, etc.), and the action is the verb that describes how the user/system interacted with the object, e.g., clicked, created, viewed, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Mini Digital also includes optional properties that cover objects and actions and help you to define your &lt;code&gt;eventName&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;entityType&lt;/code&gt; - Type of the entity or object this event relates to (e.g. "account", "crown", "IPFS resource", etc.).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;action&lt;/code&gt; - refers to the action that this event represents in past-tense verbs (e.g. "visited", "created", "minted", etc.).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;eventCategory&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This property will drive most of our examples in this article. It can be one of the five categories below, and understanding its user cases is fundamental for accurate event tracking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;screen_view_event&lt;/code&gt; - It tracks when users navigate to a page/screen.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user_outcome_event&lt;/code&gt; - It tracks when a user has completed a significant action in the product (e.g. when a user completes sign-up or uploads a file).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;system_outcome_event&lt;/code&gt; - It is used when an event happens within the system and is not immediately initialised by the user (e.g. when a scheduled task gets completed or a backend system has performed an action). Note: I will not cover examples of this user case in this article as I’m focusing on web browser integration, but remember that you can use this property to track events when they catch the server side.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;interaction_event&lt;/code&gt; - It tracks events when users interact with UI elements (e.g., the user clicks a button ou in a link).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;content_event&lt;/code&gt; - It tracks content that was interacted with (It is designed for more specific media (images, videos) or visual assets (logos, icons) than generic UI elements such as a button or a link - see &lt;code&gt;interaction_event&lt;/code&gt; for those use cases).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;eventSource&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This property refers to the area in the product or source where this event occurred (e.g. "Website.WunderbarNetwork.Router", “AccountSettings”).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Anonymous user - a quick highlight&lt;/strong&gt; 💡
&lt;/h3&gt;

&lt;p&gt;The cherry on top of Mini Digital is its anonymous user property by default, which significantly minimises your privacy policy and makes many web3 users feel relieved. This subject is so relevant that it deserves its own article, but there is an important aspect to cover here related to the two following properties of the &lt;a href="https://docs.mini.digital/core-schema/properties.html" rel="noopener noreferrer"&gt;Core Schema&lt;/a&gt; that will inform the SDK about the user acting: &lt;code&gt;primaryIdentifier&lt;/code&gt; and &lt;code&gt;anonymousUser&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;primaryIdentifier&lt;/code&gt; and &lt;code&gt;anonymousUser&lt;/code&gt; are marked as optional in the &lt;code&gt;AnalyticsEvent&lt;/code&gt; interface. However, at least one needs to be supplied.&lt;/p&gt;

&lt;p&gt;There is a third property that also plays a vital role in this relationship, which is &lt;code&gt;trackingId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To understand the relationship between these three properties, let’s follow the behaviour of a user visiting a store website. In the first moment, when the user hits the store's landing page, and this event is tracked, you usually don’t know who the user is. This is when you include the &lt;code&gt;anonymousUser&lt;/code&gt; property in your schema and set the field value as &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Mini Digital SDK generates a &lt;code&gt;trackingId&lt;/code&gt; (a random UUID) and makes the &lt;code&gt;primaryIdentifier&lt;/code&gt; the same as the &lt;code&gt;trackingId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Suppose the user performs logging in and gets identified by the system (for example, by providing their username or customer number or after connecting using a wallet). In that case, you may want to replace the &lt;code&gt;anonymousUser&lt;/code&gt; with the &lt;code&gt;primaryIdentifier&lt;/code&gt; and fill the field with the identifier data. The same &lt;code&gt;trackingId&lt;/code&gt; field will be attached to all events before and after that moment and can be used to link the actions performed before and after logging in, so you know that it is the same user all the time along.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Use cases by &lt;code&gt;eventCategory&lt;/code&gt;&lt;/strong&gt; 🖊️
&lt;/h2&gt;

&lt;p&gt;Now that you have all the pieces of the game you need, it is time to start to play.&lt;/p&gt;

&lt;p&gt;Let’s again follow the journey of a user visiting a store website to understand a bit more about how and where to track your event while developing your integration to the SDK.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;screen_view_event&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first action of a user in your product is usually navigating to a landing/homepage page.&lt;/p&gt;

&lt;p&gt;An effective way to track when a user hits a screen/page is when the page renders for the first time, like this example below of a website's homepage being mounted in a Vue.js app. You will also want to set &lt;code&gt;eventCategory&lt;/code&gt; to &lt;code&gt;screen_view_event&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;onMounted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Define event data for the homepage screen view&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;eventName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;home_page_viewed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;eventCategory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;screen_view_event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;eventSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Website.MiniDigital.Router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;entityType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;home_page&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;viewed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;anonymousUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="c1"&gt;// Send data to track when a user navigates to the homepage&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;EventTrackingService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;interaction_event&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s common to expect a user to explore a website before deciding to log in. Tracking how the user interacts with the website UI (User Interface) – clicking buttons and links or expanding sections, can provide your product team with helpful insights on how they can best improve the website. Tracking the &lt;strong&gt;Login&lt;/strong&gt; button clicked, in addition to how the user interacted with the website before login, allows the team to have a complete picture of the user journey.&lt;/p&gt;

&lt;p&gt;There are so many things your product team can do once armed with those insights. Suppose they notice that more people see the homepage than log in, and then the team creates a motivating fidelity points system. However, product teams can only plan improvement actions if they get the data. Otherwise, it will be only a guess. A dangerous land to walk on!&lt;/p&gt;

&lt;p&gt;You can track this event category by sending your data when the user clicks the button and setting your &lt;code&gt;eventCategory&lt;/code&gt; to &lt;code&gt;interaction_event&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In my example below, I have a function called &lt;code&gt;handleConnectWallet()&lt;/code&gt; to handle an event when the user clicks the button to connect their wallet. If successful, a list of accounts will be displayed, and the user can choose the one they want to use to connect their wallet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleConnectWallet&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Define event data for Connect Wallet button clicked&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;eventName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;connect_wallet_button_clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;eventCategory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;interaction_event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;eventSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Website.MiniDigital.Router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;entityType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;connect_wallet_button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;anonymousUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// Send data to track when a user connects to a wallet&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;EventTrackingService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Load account list&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkForWeb3Accounts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// If no accounts, show error&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;accountList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No web3 accounts could be found. Please check your extension(s) and try again.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;content_event&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you want to be even more specific about the content that the user interacts with, the &lt;code&gt;content_event&lt;/code&gt; property comes in handy to give even more accurate insights to your product team. It is designed to track more specific media (images, videos) or visual assets (logos, icons) than generic UI elements such as a button or a link.&lt;/p&gt;

&lt;p&gt;Where to declare it depends much on your codebase and the context where your image, logo, or icon is used - if it is a video played by the user or a banner used as a link and handled by a function like the above. However, you also want to send your event data when the user interacts with the content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;eventName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mini_digital_banner_clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;eventCategory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;content_event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;eventSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Website.MiniDigital.Router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;entityType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mini_digital_banner&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;anonymousUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;user_outcome_event&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Our last example to explore is when the user completes a significant action in the product, and our user just performed a login in our store website by choosing an account and connecting with their wallet. At this moment, all the validations were performed, and the login is successful.&lt;/p&gt;

&lt;p&gt;In my example, I have a function that handles the successful login, sends my event data to Mini Digital and takes my user to another page that he can only access once logged in.&lt;/p&gt;

&lt;p&gt;This is when you want to send your event data with your &lt;code&gt;eventCategory&lt;/code&gt; set to &lt;code&gt;user_outcome_event&lt;/code&gt;. Also, this is when the business may decide to use the identifier provided by the user. Logins are a perfect example of actions performed that allows you to update your schema by removing the &lt;code&gt;anonymousUser&lt;/code&gt; and setting your &lt;code&gt;primaryIdentifier&lt;/code&gt; to the identifier provided by the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleWalletAccountConfirmed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;walletAccount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;WalletAccount&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// Save the selected account to our state management tool&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commitWalletAccount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;walletAccount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Define event data for account successfully logged&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;eventName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wallet_account_logged&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;eventCategory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user_outcome_event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;eventSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Website.MiniDigital.Router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;entityType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wallet_account&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;logged&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;primaryIdentifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;walletAccount&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// Send data to track wallets successfully logged&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;EventTrackingService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Navigate to the dashboard&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/dashboard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note now that my user is not anonymous. I have stored my user’s identifier detail and used it to provide a value for &lt;code&gt;primaryIdentifier&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Closing up&lt;/strong&gt; 💌
&lt;/h2&gt;

&lt;p&gt;In this article, I covered how to install and import Mini Digital SDK to start integrating the SDK into your codebase. I explained how to declare and send the events using the minimum information necessary for accurate tracking. I also provided examples of what mandatory properties you must send, the perfect timing, and where to declare your event schema.&lt;/p&gt;

&lt;p&gt;I hope this article helped you better understand how to track your events most effectively to empower your product team with accurate insights.&lt;/p&gt;

&lt;p&gt;I look forward to your feedback, and stay tuned for more articles. 👋🏻&lt;/p&gt;

</description>
      <category>web3</category>
      <category>tutorial</category>
      <category>dataanalytics</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Three things I loved most about Next.js 13.4 so far</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Thu, 08 Jun 2023 06:50:24 +0000</pubDate>
      <link>https://dev.to/suzanamelo/three-things-i-loved-most-about-nextjs-13-3g5f</link>
      <guid>https://dev.to/suzanamelo/three-things-i-loved-most-about-nextjs-13-3g5f</guid>
      <description>&lt;p&gt;Next.js was first launched in October 2016 by Vercel (formerly Zeit), years before I started programming. However, I only started learning it about a month ago when I needed to develop an application as part of a technical challenge using the famous “React framework”.&lt;br&gt;
Its latest version, Next.js 13.4, brought a lot of upgrades and changes on top of what already exists.&lt;br&gt;
I don’t intend to delve deeply into those changes here - you can easily find plenty of good articles already discussing features, but I wanted to highlight what was my “love at first sight” from a newbie perspective, with no preference order. &lt;/p&gt;
&lt;h3&gt;
  
  
  Learning curve 📚
&lt;/h3&gt;

&lt;p&gt;As an immigrant woman who changed careers and entered the software development field after my 40s with no technical background, learning technology remains very challenging, especially when it is something I see for the first time. Although my love for programming and learning new things makes the process more pleasant and easier, it does not necessarily make things easier.&lt;br&gt;
However, I was surprised by how much easier it was to understand Next.js' logic and structure, which is built on top of React, providing extra features that I found very handy. The documentation is also easier to follow and understand.&lt;/p&gt;
&lt;h3&gt;
  
  
  New Project 💻
&lt;/h3&gt;

&lt;p&gt;Next 13.4 offers you TypeScript and TailwindCSS by default, which is fantastic. I’d decided to use TypeScript to build a side project, but you can also use JavaScript or JSX. It is up to you. &lt;br&gt;
I learned software development by doing a bootcamp that utilized JavaScript as its core programming language. Although I used TS for a few months in a startup I previously worked with, it is still very challenging for me, and I love it. &lt;br&gt;
To start to play around with the latest version of Next.js, run the following command to create a new project (you will also need to have Node.js 16.8 or later):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You will be asked these prompts before putting your hands on the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is your project named? my-app
Would you like to use TypeScript with this project? No / Yes
Would you like to use ESLint with this project? No / Yes
Would you like to use Tailwind CSS with this project? No / Yes
Would you like to use `src/` directory with this project? No / Yes
Use App Router (recommended)? No / Yes
Would you like to customize the default import alias? No / Yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Structure
&lt;/h4&gt;

&lt;p&gt;Once the project is ready and you open it on your IDE (I use Visual Studio Code), you will have a structure like that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyh3ln044g7wdr0jnap4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyh3ln044g7wdr0jnap4.png" alt=" " width="634" height="1114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To see it in your &lt;em&gt;localhost:3000&lt;/em&gt;, start up the dev server by running the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Love number 1: Routing ❤️
&lt;/h2&gt;

&lt;p&gt;As per Next.js documentation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In version 13, Next.js introduced a new App Router built on React Server Components, which supports shared layouts, nested routing, loading states, error handling, and more. The App Router works in a new directory named app. The app directory works alongside the pages directory to allow for incremental adoption.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What does it mean?&lt;/strong&gt;&lt;br&gt;
Creating a route in Next.js 13 is ridiculously simple. &lt;br&gt;
Inside the &lt;code&gt;app&lt;/code&gt; directory/folder, you have a &lt;code&gt;page&lt;/code&gt; file (in my case, &lt;em&gt;page.tsx&lt;/em&gt;), which is your app homepage. Inside that main app directory, create a folder with the name of the route you want, and inside that &lt;code&gt;route/folder&lt;/code&gt;, create a file called &lt;code&gt;page.tsx&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftix2kn9a3y8wuziusivc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftix2kn9a3y8wuziusivc.png" alt=" " width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, I created a route to an About page by creating a directory called &lt;code&gt;about&lt;/code&gt; and a &lt;code&gt;page.tsx&lt;/code&gt; inside it. In the &lt;code&gt;page.tsx&lt;/code&gt; file, I included an arrow function component that returns a title and content.&lt;br&gt;
If you repeat these steps and go to &lt;em&gt;localhost:3000/about&lt;/em&gt;, you will see the text content from the AboutPage component, as I did. And that is all you need to do. Easier like that!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9x43ztf8smu6jygjg3w2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9x43ztf8smu6jygjg3w2.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that folders are used to define &lt;em&gt;routes&lt;/em&gt;, and files are used to create the UI for that route. The folder's name is the &lt;em&gt;route&lt;/em&gt;, and its file is called &lt;code&gt;page.tsx&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;
  
  
  Nested routes
&lt;/h4&gt;

&lt;p&gt;To create nested routes, you need to repeat the same steps, but this time in the route folder. In my example, I implemented a route for &lt;code&gt;/about/team&lt;/code&gt; by creating a folder called &lt;code&gt;team&lt;/code&gt; inside the &lt;code&gt;about&lt;/code&gt; folder. In the &lt;code&gt;team&lt;/code&gt; folder, I created a new &lt;code&gt;page.tsx&lt;/code&gt; file displaying a title and content. Once saved, the content of TeamPage was rendered on &lt;em&gt;localhost:3000/about/team&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ojht32a58evon4n6keq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ojht32a58evon4n6keq.png" alt=" " width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, my project side is minimal and straightforward. Big and complex projects will demand a planned folder distribution and structure, but from my learning curve perspective, creating a route in Next.js was very easy to understand and execute.&lt;/p&gt;
&lt;h2&gt;
  
  
  Love number 2: Layout ❤️
&lt;/h2&gt;

&lt;p&gt;Another great feature of Next.13 that I loved is the layout.&lt;br&gt;
As per Next.js,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A layout is UI that is shared between multiple pages. On navigation, layouts preserve state, remain interactive, and do not re-render.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you create your new Next.js project, the &lt;code&gt;layout&lt;/code&gt; file is also included next to the main &lt;code&gt;page.tsx&lt;/code&gt;. It is a simple React component where you can add a header, footer, and any other content you want to appear on every page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5fyac1m1l35pihtfp41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5fyac1m1l35pihtfp41.png" alt=" " width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the image above, this is also where you will include your &lt;em&gt;metadata&lt;/em&gt;, such as title, description, keywords, and so on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const metadata = {
  title: 'Create Next App',
  description: 'Generated by create next app',
}

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

&lt;/div&gt;



&lt;p&gt;You can also easily include fonts from Google. The layout provided in your initial project consists of an example of importing Google fonts straightforwardly. &lt;br&gt;
You just need to import the font you want and store it in a variable like that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Inter } from 'next/font/google'

const inter = Inter({ subsets: ['latin'] })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also add other attributes you need for your project. Here is another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Poppins } from 'next/font/google';

const poppins = Poppins({
  weight: ['400', '600'],
  subsets: ['latin'],
});

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

&lt;/div&gt;



&lt;p&gt;To apply the font to your project, simply add the className to the tag you want to use it on. The Next.js boilerplate applies the className to the body of the project:&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;html lang="en"&amp;gt;
      &amp;lt;body className={inter.className}&amp;gt;{children}&amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
  )

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Nested layouts
&lt;/h4&gt;

&lt;p&gt;As per Next.js documents, Layouts can also be nested.&lt;br&gt;
You can customise a layout for a specific page by adding a new layout file in the folder you want.&lt;/p&gt;

&lt;p&gt;Here is how Next.js docs illustrate an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmujld70yweib68arwf0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmujld70yweib68arwf0a.png" alt=" " width="550" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s go back to the About page I mentioned previously. I can create a different layout for that page by creating an &lt;code&gt;about/layout.tsx&lt;/code&gt; file next to my &lt;code&gt;about/page.tsx&lt;/code&gt;. In this file, I defined a React component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function AboutLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    &amp;lt;&amp;gt;
      &amp;lt;div&amp;gt;{children}&amp;lt;/div&amp;gt;
    &amp;lt;/&amp;gt;
  );
}

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

&lt;/div&gt;



&lt;p&gt;Your creativity (or the project requirements) is the limit. You can include a new font or metadata in your custom layout, or you may want a different container, a sidebar, or any other layout you need for your project.&lt;/p&gt;

&lt;p&gt;My thought on this feature is that I was guided by a fantastic senior to keep my CSS files at the same level as their respective files. Having everything in the main styles folder would quickly become very messy and make it harder to coordinate changes from a maintenance perspective in the future. Next.js, applying the same concept with the nested layout file, made a lot of sense.&lt;br&gt;
You can read more about pages and routing on this &lt;a href="https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts" rel="noopener noreferrer"&gt;page&lt;/a&gt; of Next.js docs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Love number 3: Server Components ❤️
&lt;/h2&gt;

&lt;p&gt;This feature took me the most time and effort to understand, but once I grasped the concept, it looked fascinating and full of opportunities for experimentation and learning.&lt;/p&gt;

&lt;p&gt;As per Next.js docs, let’s quickly highlight two crucial definitions of this feature.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The client refers to the browser on a user's device that sends a request to a server for your application code. It then turns the response from the server into an interface that the user can interact with.&lt;/p&gt;

&lt;p&gt;The server refers to the computer in a data center that stores your application code, receives requests from a client, does some computation, and sends back an appropriate response.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;NextJS 13 includes a Server Components feature by default, and as per its documents:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“allowing you to render components on the server easily and reducing the amount of JavaScript sent to the client.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What does it mean?&lt;/strong&gt;&lt;br&gt;
Servers can process JavaScript and create documents faster than a client. &lt;br&gt;
For Server Side Rendering, your service response to the browser is the HTML of your page, ready to be rendered. It will start rendering the HTML from your server without waiting for all the JavaScript to be downloaded and executed, the opposite of what happens on the Client Side Rendering.&lt;/p&gt;

&lt;p&gt;I followed Next.js recommendations for fetching data in Server Components.&lt;br&gt;
I tried simple data fetching, and I found it to be easier and straightforward.&lt;/p&gt;

&lt;p&gt;✔️ Here is what I did: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I created a Server Component called Repos to render my repositories on GitHub.&lt;/li&gt;
&lt;li&gt;Created an async function called &lt;code&gt;getRepos()&lt;/code&gt; and used the Next.js &lt;code&gt;fetch()&lt;/code&gt; API - you can learn more about it on the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" rel="noopener noreferrer"&gt;Next.js docs&lt;/a&gt; - to get the data I wanted from the GitHub API and fetch it straight away in the component.&lt;/li&gt;
&lt;li&gt;I called the &lt;code&gt;getRepos()&lt;/code&gt; and returned the details I needed to display, such as the name and description of my GitHub repositories.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fab0t83ifn0e3nxykiwv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fab0t83ifn0e3nxykiwv5.png" alt=" " width="631" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Last thoughts 📌
&lt;/h3&gt;

&lt;p&gt;I just started diving deep into this exciting framework, and I loved the experience of playing around with Next.js.&lt;br&gt;
It has downsides, and there is a lot to explore and learn from. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server Components are less interactive than Client Components. &lt;/li&gt;
&lt;li&gt;They can’t be a component state, and you can’t use the &lt;code&gt;useState&lt;/code&gt; hook.&lt;/li&gt;
&lt;li&gt;It also doesn’t support lifecycle methods, and you can’t use the &lt;code&gt;useEffect&lt;/code&gt; hook, which is handy for a component where you need to keep re-rendering, e.g., a search component.&lt;/li&gt;
&lt;li&gt;If you want to use the &lt;code&gt;useState&lt;/code&gt; hook and make it interactive, you need to make it a Client Component by adding &lt;em&gt;‘use client’&lt;/em&gt; to the top of the component, but I’m going to leave this step for another day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still, many developers in the community are already excited about these new features, as they can combine some of the interactive experiences of client-side apps with the improved performance of traditional server-rendered applications.&lt;br&gt;
Server Components improve the initial page loading time, simplify data fetching, and improve access to databases and file systems.&lt;/p&gt;

&lt;p&gt;As I mentioned, these thoughts are from my perspective and take into account my ongoing learning process, which is constantly evolving.&lt;br&gt;
If you're already familiar with Next.js, I would love to hear your insights on the new features and what I can experiment with. If you are new to that, like me, I hope I've piqued your curiosity to try and share your thoughts. 🚀&lt;/p&gt;

</description>
      <category>react</category>
      <category>nextjs</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>How I prepared myself for the AWS Cloud Practitioner Certificate</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Tue, 30 May 2023 03:37:43 +0000</pubDate>
      <link>https://dev.to/suzanamelo/how-i-prepared-myself-for-the-aws-cloud-practitioner-certificate-5a1f</link>
      <guid>https://dev.to/suzanamelo/how-i-prepared-myself-for-the-aws-cloud-practitioner-certificate-5a1f</guid>
      <description>&lt;p&gt;Once you choose a technology life, Cloud is inevitable. ☁️&lt;/p&gt;

&lt;p&gt;The hottest trend in the information technology field is Cloud Computing, and you will bump into it. It is a matter of time.&lt;br&gt;
This happened to me in my second job as a developer (I changed careers into software development around two years ago, after my 40s, and having no tech background). After almost a year of mainly handling components in React in a frontend environment, with minimal contact with the deployment circle, I started to work as a full-stack developer in a startup, and the stack included AWS.&lt;/p&gt;

&lt;p&gt;If you're in the same boat, an absolute beginner like I was when I first started, I recommend taking a quick detour to this article first: &lt;a href="https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe"&gt;Cloud Computing: What it is and why should tech beginners learn it?&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS
&lt;/h4&gt;

&lt;p&gt;AWS is made up of many different Cloud Computing products and services, and I often find myself lost in the midst of tools I had never heard of before, such as AWS Lambdas, API Gateway, Amazon S3, and others. At that moment, I realized that it was crucial knowledge for growing in my career, and I decided to explore more about this new, exciting world called Cloud Computing.&lt;br&gt;
If you are new to AWS, the AWS Cloud Practitioner certification exam serves as your entry point. I didn’t need a certification to perform my work. However, certificates give you visibility and help you to show off your achievements and learning. With the advancement of technology and the growth of the number of professionals in tech, certifications have become a way of presenting a competitive advantage.&lt;/p&gt;




&lt;h2&gt;
  
  
  The exam 💻
&lt;/h2&gt;

&lt;p&gt;The AWS Cloud Practitioner exam tests your foundational understanding of AWS Cloud concepts, services, and terminologies. You have 90 minutes to complete the exam, with 65 questions, either multiple-choice or multiple responses. The test costs USD 100, and the score goes from 100 to 1,000. The minimum passing score is 700.&lt;br&gt;
You can take the exam at the Pearson VUE testing center or online. I decided to do it in person to avoid concerns such as power outages, internet dropout risks, or the requirements related to the online exam.&lt;br&gt;
If you don’t have a testing center close by or prefer to do it online, be aware of the requirements to guarantee the integrity of the test, such as asking you to show the room and check you via the webcam the whole time to ensure you look at your screen only. Avoid noise and keep your desk and surroundings clear of multiple objects. Ensure you are alone or ask your family not to disturb you during your exam. And don’t forget to have your identification document nearby. &lt;br&gt;
I have heard of cases where people had their exams canceled due to issues like these, so pay attention to what they ask you to do before the exam.&lt;br&gt;
This exam can be completed in the following languages: English, French (France), German, Indonesian, Italian, Japanese, Korean, Portuguese (Brazil), Simplified Chinese, Spanish (Latin America), Spanish (Spain), and Traditional Chinese.&lt;br&gt;
The exam will include questions on four main domains: Cloud Concepts (26%), Security and Compliance (25%), Technology (33%), and Billing and Pricing (16%).&lt;br&gt;
The exam is not divided by domain sections. The questions can include more than one area, depending on the service. You don’t need to achieve a passing score in each section. You only need to pass the overall exam.&lt;/p&gt;




&lt;h2&gt;
  
  
  Preparation for the exam 📚
&lt;/h2&gt;

&lt;p&gt;Fortunately, I got all the support from the AWS CloudUp for Hāpori Wāhine Program, the &lt;a href="https://pages.awscloud.com/cloudup-for-her-cloud-practitioner.html" rel="noopener noreferrer"&gt;CloudUp for Her Cloud Practitioner&lt;/a&gt; in New Zealand. It is an online bootcamp that provides you with resources and support to prepare yourself for the exam. It’s planned for women to support women in getting to know the Cloud.&lt;br&gt;
Being surrounded by a supportive and incredible team of women makes an immensely positive impact on your journey. However, you can definitely prepare yourself well and for free to take the exam and get the certification beautifully. Essentially, the content of the bootcamp lies in what is already provided by AWS on their pages. &lt;br&gt;
I completed the &lt;a href="https://explore.skillbuilder.aws/learn/course/external/view/elearning/134/aws-cloud-practitioner-essentials" rel="noopener noreferrer"&gt;AWS Cloud Practitioner Essentials course&lt;/a&gt; and other free courses offered at the &lt;a href="https://explore.skillbuilder.aws/learn/signin" rel="noopener noreferrer"&gt;AWS training and certification page&lt;/a&gt;. I also checked out some of the resources listed at the end of this article.&lt;br&gt;
You can find more details of the AWS Cloud Practitioner Essentials course in this article &lt;a href="https://dev.to/aws-builders/how-to-get-started-with-aws-for-absolute-beginners-3m7d"&gt;How to get started with AWS (for absolute beginners)&lt;/a&gt;.&lt;br&gt;
The AWS Certified Cloud Practitioner page and documentation already include valuable resources.&lt;br&gt;
Once you delve into the content, understanding what problem each service solves and its corresponding use cases is vital. My exam included many questions simulating a customer's necessity, and I needed to choose the best service to sort that demand.&lt;br&gt;
The quantity of services is vast, and it is impossible to know everything, but there are some critical points for you to look at closely.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cloud Concepts:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Benefits of the cloud - e.g., elasticity, agility, scalability, pay-as-you-go, economy of scale.&lt;/li&gt;
&lt;li&gt;The aspects of AWS Cloud economics - e.g., understanding labor costs associated with on-premises operations, right-sized infrastructure, and managed services (e.g., RDS, ECS, EKS, DynamoDB).&lt;/li&gt;
&lt;li&gt;The different cloud architecture design principles, e.g., design for failure and decoupled components versus monolithic architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Security and Compliance:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Shared responsibility model.&lt;/li&gt;
&lt;li&gt;Cloud security and compliance concepts - e.g., identify different encryption options on AWS (e.g., In transit, At rest), describe who enables encryption on AWS for a given service, understand the concept of least privileged access, Amazon CloudWatch, AWS Config, AWS CloudTrail, etc.&lt;/li&gt;
&lt;li&gt;AWS access management capabilities - e.g., MFA, IAM.&lt;/li&gt;
&lt;li&gt;Resources for security support - e.g., security groups, Network ACLs, Transit Gateway, Load Balancer, AWS Shield,  AWS WAF,  AWS Trusted Advisor, and AWS Inspector.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Technology
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Understanding the methods of operating in the AWS Cloud - e.g., programmatic access, APIs, SDKs, AWS Management Console, CLI, Infrastructure as Code, different cloud deployment models (cloud native, hybrid, and on-premises), and connectivity options.&lt;/li&gt;
&lt;li&gt;Learn about AWS global infrastructure - e.g., Regions, Availability Zones, Edge Locations, disaster recovery/business continuity, Amazon CloudFront, and AWS Global Accelerator.&lt;/li&gt;
&lt;li&gt;Identify the core AWS services - e.g., compute services (AWS Lambda, Amazon ECS, EC2, etc.), storage services (Amazon S3, EBS, EFS, the Snowball family, AWS Storage Gateway, etc.), networking services (Amazon Route 53, VPC, VPN, AWS Direct Connect, etc.), database services (Amazon RDS, DynamoDB, Redshift, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Billing and Pricing
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Learn to compare and contrast the various pricing models for AWS (e.g., On-Demand Instances, Reserved Instances, and Spot Instance pricing) to find the best fit.&lt;/li&gt;
&lt;li&gt;Understand the account structures of AWS billing and pricing - e.g., AWS Organizations.&lt;/li&gt;
&lt;li&gt;Understand resources available for billing support - e.g., Cost Explorer, AWS Cost and Usage Report, and QuickSight.&lt;/li&gt;
&lt;li&gt;Review AWS support plans, their benefits, and to whom each plan applies, and try to understand how to improve the cost of services.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final considerations 📌
&lt;/h2&gt;

&lt;p&gt;The coolest thing about the journey of preparing for certification is the knowledge we get while studying for the exam. I could understand what I was doing at work, as well as many other related things I didn’t know about before the certification.&lt;br&gt;
I have no regrets about the time I spent preparing for my AWS Cloud Practitioner Certificate exam, and I enjoyed all the steps of my rewarding learning journey. I have been collecting countless benefits from it since I first started, such as being invited by friends to create and run a new AWS meetup group focused on &lt;a href="https://www.meetup.com/auckland-aws-tools-meetup/" rel="noopener noreferrer"&gt;Tools and Programming&lt;/a&gt;, where I could start to help beginners like me take their first steps into this fantastic world. After becoming an &lt;a href="https://builder.aws.com/connect/community/user-groups" rel="noopener noreferrer"&gt;AWS User Group&lt;/a&gt; leader in 2023, I also became an &lt;a href="https://builder.aws.com/connect/community/community-builders" rel="noopener noreferrer"&gt;AWS Community Builder&lt;/a&gt; in the same year, and it has been wonderful so far!&lt;/p&gt;

&lt;p&gt;AWS often promotes fantastic certification campaigns and sometimes even 100% discount vouchers. To keep an eye on these campaigns, follow AWS and AWS Technical Trainers on social media and &lt;a href="https://www.linkedin.com/company/amazon-web-services/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;br&gt;
Once you receive your certificate, practice what you have learned and begin building cloud projects. There are many cool beginner projects on the Internet for you to start putting your hands on.&lt;br&gt;
You can find additional resources to keep upskilling in the list of free AWS training courses available in my GitHub repository: &lt;a href="https://github.com/suzanamelomoraes/AWSfree" rel="noopener noreferrer"&gt;Free AWS training courses&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope I have helped you succeed in your exam! 🚀&lt;/p&gt;

&lt;p&gt;Note: I share my experience in this article regarding taking the AWS Certified Cloud Practitioner (CLF-C01) exam. AWS now offers the CLF-C02 exam, which includes new services and area improvements. The study resources shared in this article have already been updated by their owners to match the latest version. The structure, including the number of questions, passing score, and other details, remains the same.&lt;/p&gt;




&lt;h2&gt;
  
  
  Resources:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  To study
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/suzanamelomoraes/AWSfree" rel="noopener noreferrer"&gt;Free AWS training courses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://explore.skillbuilder.aws/learn/public/learning_plan/view/82/cloud-essentials-knowledge-badge-readiness-path?trk=584fad87-840e-461e-9281-280915222830&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Cloud Essentials - Knowledge Badge Readiness Path&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://explore.skillbuilder.aws/learn/course/external/view/elearning/11458/aws-cloud-quest-cloud-practitioner" rel="noopener noreferrer"&gt;AWS Cloud Quest: Cloud Practitioner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/training/events/" rel="noopener noreferrer"&gt;Training events for free&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pages.awscloud.com/global-traincert-twitch-power-hour-cloud-practitioner.html" rel="noopener noreferrer"&gt;Power Hour Cloud Practitioner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/getting-started/cloud-essentials/" rel="noopener noreferrer"&gt;AWS Cloud Essentials&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FreeCodeCamp - AWS Certified Cloud Practitioner Study &lt;a href="https://www.freecodecamp.org/news/aws-certified-cloud-practitioner-certification-study-course-pass-the-exam" rel="noopener noreferrer"&gt;Course&lt;/a&gt;&lt;br&gt;
and its &lt;a href="https://www.youtube.com/watch?v=SOTamWNgDKc" rel="noopener noreferrer"&gt;YouTube video&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  The exam
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/certification/certified-cloud-practitioner" rel="noopener noreferrer"&gt;AWS Certified Cloud Practitioner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/training/learn-about/cloud-practitioner" rel="noopener noreferrer"&gt;Learn more about Cloud practitioner&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  To practice (FREE and paid options)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=lDEFXtpEhLY" rel="noopener noreferrer"&gt;AWS Certified Cloud Practitioner Exam Questions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.whizlabs.com/aws-certified-cloud-practitioner/" rel="noopener noreferrer"&gt;Whizlabs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.koenig-solutions.com/AWS" rel="noopener noreferrer"&gt;Koenig&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://digitalcloud.training/aws-cloud-practitioner-free-practice-questions/" rel="noopener noreferrer"&gt;DigitalCloud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://portal.tutorialsdojo.com/courses/free-aws-certified-cloud-practitioner-practice-exams-sampler/" rel="noopener noreferrer"&gt;Tutorials Dojo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.awsboy.com/aws-practice-exams/" rel="noopener noreferrer"&gt;AWS Boy&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Fundamentals
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/aws-builders/cloud-computing-why-should-tech-beginners-learn-it-2khe"&gt;Cloud Computing: What it is and why should tech beginners learn it?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/aws-builders/how-to-get-started-with-aws-for-absolute-beginners-3m7d"&gt;How to get started with AWS (for absolute beginners)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building a Loan Calculator using React Hooks</title>
      <dc:creator>Suzana Melo</dc:creator>
      <pubDate>Thu, 03 Sep 2020 12:56:00 +0000</pubDate>
      <link>https://dev.to/suzanamelo/building-a-loan-calculator-using-react-hooks-141o</link>
      <guid>https://dev.to/suzanamelo/building-a-loan-calculator-using-react-hooks-141o</guid>
      <description>&lt;p&gt;Are you just starting with React?  Are you wondering what you can build that’s simple and achievable?  Well, so was I, and so I wrote this article to share my experience and learning with you.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are we building? 💻
&lt;/h3&gt;

&lt;p&gt;Like I promised, we're going to keep it simple and build a basic loan calculator that will take user input for the loan amount, interest rate and loan term, and display a monthly payment,  and totals for the repayment amount and interest.&lt;/p&gt;

&lt;p&gt;We're going to build a form to receive the input values and display the results. Along the way,  we’ll manage form state, handle validation, and define event handlers to tie everything together.&lt;/p&gt;

&lt;p&gt;To follow along you’ll need basic understanding of JavaScript, particularly ES6 features such as &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" rel="noopener noreferrer"&gt;destructuring&lt;/a&gt;, the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax" rel="noopener noreferrer"&gt;spread operator&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="noopener noreferrer"&gt;arrow functions&lt;/a&gt;. You also need to have Node.js installed, and a text editor of your choice. I personally use Visual Studio Code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why? 🤔
&lt;/h3&gt;

&lt;p&gt;I did this project in vanilla JavaScript while doing a course from &lt;a href="https://www.traversymedia.com/" rel="noopener noreferrer"&gt;Brad Traversy&lt;/a&gt; on &lt;a href="https://www.udemy.com/course/modern-javascript-from-the-beginning/" rel="noopener noreferrer"&gt;Udemy&lt;/a&gt; and I loved the experience of building the whole application from scratch. I decided to rebuild this project using React Hooks to see the benefits React brings when you need to manage and manipulate the UI such as grabbing inputs from the UI and also creating new elements to display the results to the user. &lt;/p&gt;

&lt;p&gt;I also wanted to demonstrate the React hooks API, which allows function components to have state and utilise lifecycle methods under the hood. In past versions of React, class components were the only way to manage state. This makes for a much better development experience 🤩.&lt;/p&gt;

&lt;p&gt;You can also find the code for this project here:&lt;br&gt;
&lt;a href="https://github.com/suzanamelomoraes/loan-calculator-react-hooks" rel="noopener noreferrer"&gt;https://github.com/suzanamelomoraes/loan-calculator-react-hooks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Shall we start? 👍
&lt;/h3&gt;

&lt;p&gt;Section 1 - Create-React-App&lt;br&gt;
Section 2 - Add some CSS&lt;br&gt;
Section 3 - Create the component&lt;br&gt;
Section 4 - Add state&lt;br&gt;
Section 5 - Create a form / controlled component&lt;br&gt;
Section 6 - Form Submission&lt;br&gt;
Section 7 - Calculate the results&lt;br&gt;
Section 8 - Display the results&lt;br&gt;
Section 9 - Validate the results / Manage errors&lt;br&gt;
Section 10 - Recalculate&lt;/p&gt;
&lt;h2&gt;
  
  
  Section 1
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create-React-app&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We don't need anything complicated to make this project so we'll use the boilerplate &lt;a href="https://reactjs.org/docs/create-a-new-react-app.html" rel="noopener noreferrer"&gt;Create-React-App&lt;/a&gt; gives us. To create the project, navigate to a directory of your choice and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g create-react-app
create-react-app loan-calculator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or optionally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app loan-calculator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the create-react-app finishes running, you can navigate into the project:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To open the project in Visual Code (or your preferred editor):&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Finally, to run the project:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You can clear up your boilerplate as you wish. I usually delete the icons and related stuff, but it’s totally up to you. If you accidentally delete some essential file, just repeat the steps and create a new boilerplate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 2
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Styling won't be the focus of this tutorial, so feel free to copy this CSS into your &lt;em&gt;App.css&lt;/em&gt; if you want — or add any styling you prefer. You can also find how I applied my classes in my repository on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/App.css&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;95%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;border-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;lightgray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#555&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.calculator&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.form&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.form-items&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#label&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Section 3
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create the component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the &lt;em&gt;src&lt;/em&gt; folder, we will create another folder called &lt;em&gt;components&lt;/em&gt; and then, inside it, create a file called &lt;em&gt;Calculator.jsx&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Calculator.jsx&lt;/em&gt; is a functional component which sets a header and imports React. Your initial Calculator component will look like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/components/Calculator.jsx&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Calculator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
       &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loan Calculator&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Calculator&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can include your &lt;em&gt;Calculator.jsx&lt;/em&gt; in &lt;em&gt;App.js&lt;/em&gt; like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Calculator&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/Calculator&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Calculator&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
 &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Section 4
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Adding state&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Remember from earlier that we need three pieces of information from the user to perform the loan calculation: the loan amount, interest rate, and the loan term. We’ll use state to hold these values for us.&lt;/p&gt;

&lt;p&gt;Ready to make our component stateful?  First up,  we’re going to add the &lt;em&gt;useState&lt;/em&gt; hook, which allows React to manage your components’ state. Back in your &lt;em&gt;Calculator.jsx&lt;/em&gt;, amend the first line to include React’s state handler, &lt;em&gt;useState&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/components/Calculator.jsx&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need to “use” the hook. The React documentation gives us this pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we’ll implement it, above our &lt;em&gt;return&lt;/em&gt;, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUserValues&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
   &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first item we’re destructuring, &lt;em&gt;userValues&lt;/em&gt; is the name of our state and where we will store the input values given by the user. You can give it any name you want, however, it is good practice to choose meaningful names related to your application.&lt;/p&gt;

&lt;p&gt;The second item, &lt;em&gt;setUserValues&lt;/em&gt; is a method returned by the &lt;em&gt;useState&lt;/em&gt; hook, that allows us to set the state.&lt;/p&gt;

&lt;p&gt;Finally, the argument we provide to &lt;em&gt;useState&lt;/em&gt; is the value we want to be the default value of the state. In this case, we have an object with these three properties, each assigned an empty string.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 5
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create a form / controlled component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To perform our calculation we need to collect information from the user, so let’s include the form with the inputs we need to receive this data. Initially, our form will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Amount:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'amount'&lt;/span&gt;
        &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Loan amount'&lt;/span&gt;
      &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Interest:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'interest'&lt;/span&gt;
        &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Interest'&lt;/span&gt;
      &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
More code...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Controlled components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually, React forms are implemented using &lt;a href="https://reactjs.org/docs/forms.html" rel="noopener noreferrer"&gt;controlled components&lt;/a&gt; - where the data is handled by a React component.&lt;/p&gt;

&lt;p&gt;Let's go ahead and implement our components as controlled components:&lt;/p&gt;

&lt;p&gt;Assign the value of the input from the state like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'amount'&lt;/span&gt;
  &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Loan amount'&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, write an event handler on the &lt;em&gt;onChange&lt;/em&gt; prop to update the state when the user enters a loan amount.&lt;/p&gt;

&lt;p&gt;Include an &lt;em&gt;onChange&lt;/em&gt; prop to each input and set it to a function to handle the change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'amount'&lt;/span&gt;
  &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Loan amount'&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleInputChange&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add a function to handle the state change. You can use the spread operator inside the new function to update the &lt;em&gt;userValues&lt;/em&gt; state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleInputChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
   &lt;span class="nf"&gt;setUserValues&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to do the same with all three inputs we want in our application (amount, interest and years) to make sure we are adding the right values given by the user to our &lt;em&gt;userValues&lt;/em&gt; state. &lt;/p&gt;

&lt;p&gt;As you can notice, we are using bracket notation here instead of writing a function to address each input. You can read more about it &lt;a href="https://github.com/nodesecurity/eslint-plugin-security/blob/master/docs/the-dangers-of-square-bracket-notation.md" rel="noopener noreferrer"&gt;here&lt;/a&gt; and &lt;a href="https://stackoverflow.com/questions/57960770/securely-set-unknown-property-mitigate-square-bracket-object-injection-attacks/58179430#58179430" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 6
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Form Submission&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, we have captured the values and stored them in state. Now it is time to do something with the given data on submission.&lt;/p&gt;

&lt;p&gt;Let’s include a submit button in our form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'submit'&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also need to handle the values given by the user once they submit the form. To do this, we need to call the &lt;em&gt;onSubmit&lt;/em&gt; method and pass our function that handles this submission as an argument like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, after the &lt;em&gt;handleInputChange&lt;/em&gt; handler, we can write our &lt;em&gt;handleSubmitValues&lt;/em&gt; function that will receive the event as an argument. &lt;/p&gt;

&lt;p&gt;There's one thing we need to do first though. On form submission, the default behaviour is to reload/redirect the page. To avoid this, we need to call the &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault" rel="noopener noreferrer"&gt;preventDefault()&lt;/a&gt;&lt;/em&gt; method on the event.&lt;/p&gt;

&lt;p&gt;At this point, we can log the input values in the console, and our function will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Section 7
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Calculate the results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, you should be able to receive the data from the user and see it in your console, If it’s not happening, don’t panic. Welcome to the world of software development! &lt;br&gt;
Breathe, review the steps and check my repository on &lt;a href="https://github.com/suzanamelomoraes/loan-calculator-react-hooks" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; if you wish.&lt;/p&gt;

&lt;p&gt;Once we have the data, it’s time to calculate! But first, the calculation will generate new values, and we need to store them somewhere. So, to make the code more readable and easy to maintain let’s create another state to store these results, so they can be displayed in the UI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setResults&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
   &lt;span class="na"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;totalPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;totalInterest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="na"&gt;isResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note I also included a fourth variable &lt;em&gt;isResult&lt;/em&gt; that will help the component know whether it needs to display the results to the user. Don't worry about it now; it will make more sense soon.&lt;/p&gt;

&lt;p&gt;You can now delete the &lt;em&gt;console.log&lt;/em&gt; and call the &lt;em&gt;calculateResults&lt;/em&gt; function when handling the values submitted and send the data into it as an argument like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="nf"&gt;calculateResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we have a place where we can store the values given by the user and another one to store the results, we can perform the calculation itself.&lt;/p&gt;

&lt;p&gt;I’m not gonna go in details of how this calculation works, as this is a method you can find easily on the internet, and it is not the focus of this article, but some points of this function are important to highlight. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default, inputs capture user input as strings, not numbers (to avoid this, we could use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number" rel="noopener noreferrer"&gt;number inputs&lt;/a&gt;, but browsers render these inputs with stepper arrows, which I wanted to avoid here). To turn our strings into numbers, we need to wrap our values inside &lt;em&gt;Number()&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;You can call your variables whatever you wish, but keep in mind the names must make sense to whoever looks at code again in the future.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is our function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calculateResults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userAmount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calculatedInterest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calculatedPayments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;calculatedInterest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;calculatedPayments&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;monthly&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userAmount&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;calculatedInterest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isFinite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;monthly&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;monthlyPaymentCalculated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;monthly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;totalPaymentCalculated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;monthly&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;calculatedPayments&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;totalInterestCalculated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;monthly&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;calculatedPayments&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;userAmount&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

     &lt;span class="c1"&gt;// Set up results to the state to be displayed to the user&lt;/span&gt;
     &lt;span class="nf"&gt;setResults&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;monthlyPaymentCalculated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;totalPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;totalPaymentCalculated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;totalInterest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;totalInterestCalculated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;isResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are destructuring &lt;em&gt;userValues&lt;/em&gt; data to perform the calculation and putting the results into the &lt;em&gt;results&lt;/em&gt; state.&lt;/p&gt;

&lt;p&gt;Note that, to do this, we are setting all the values at the same time and replacing the whole object at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 8
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Display the results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yeah! We have results! If you &lt;em&gt;console.log(newResults)&lt;/em&gt; you will now see the results you are getting from your calculation. Now let’s show these values to the user. After all, they are waiting for it!&lt;/p&gt;

&lt;p&gt;Let’s create a form to display the results. I wanted to keep the same layout and style of the first form. The difference now is, as you are creating a form only to display data, don’t forget to disable the inputs.&lt;/p&gt;

&lt;p&gt;We want a field with a corresponding label for each result. Also, it is good to remind the user of the values they gave to us, so let’s include this information again to make sure our user has all the information they need.&lt;/p&gt;

&lt;p&gt;Our form will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h4&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    Loan amount: $&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;br&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt; 
    Interest:&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;% &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;br&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt; 
    Years to repay: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h4&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Monthly Payment:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monthlyPayment&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Total Payment: &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;totalPayment&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt; 
    &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Total Interest:&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'text'&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;totalInterest&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;disabled&lt;/span&gt; 
    &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we can include a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator" rel="noopener noreferrer"&gt;ternary operator&lt;/a&gt; to render the form differently, depending on whether we have results to display. Do you remember the &lt;em&gt;isResult&lt;/em&gt; variable from earlier?  I told you it will help us to display the results later!&lt;/p&gt;

&lt;p&gt;The default value of &lt;em&gt;isResult&lt;/em&gt; is false, but when the calculation is done and we add the results to the state, we also set this condition to true.&lt;/p&gt;

&lt;p&gt;What does it mean? We can apply it to define what we are going to display. When &lt;em&gt;isResult&lt;/em&gt; is false we show the part of the form that collects the data from the user; then once we calculate the loan, we also change &lt;em&gt;isResult&lt;/em&gt; to true, and this way we display only the part with the results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isResult&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="c1"&gt;//   Form to collect data from the user&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="c1"&gt;//   Form to display the results to the user&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Section 9
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Validate the results / Manage errors&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are almost done, and everything is working. Beautiful! 😍&lt;br&gt;
But hold on; we cannot forget an important step: we need to validate the values given to us to avoid issues with our calculation. Also, we need to tell the user if something goes wrong. &lt;/p&gt;

&lt;p&gt;First, let’s create another state to help us to manage the error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can write a function whose only goal in life is to check for input errors and set the message related to this error. This function should return true if all of the inputs were valid, or false if there were any problems with the input.&lt;/p&gt;

&lt;p&gt;We will check if the user forgot to provide any values, also if the values are all numbers, and finally if the numbers are positive.  For purposes of this application, we consider 0 not to be a positive number.&lt;/p&gt;

&lt;p&gt;Our function will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;actualError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="c1"&gt;// Validate if there are values&lt;/span&gt;
   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;interest&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;actualError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;All the values are required&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="c1"&gt;// Validade if the values are numbers&lt;/span&gt;
   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;actualError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;All the values must be a valid number&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="c1"&gt;// Validade if the values are positive numbers&lt;/span&gt;
   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
     &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
     &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
     &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
   &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;actualError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;All the values must be a positive number&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;actualError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;actualError&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we also can update our function that handles the submit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isValid&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nf"&gt;calculateResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userValues&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the data is validated on submit, valid data will reset the error message to null, and then we calculate and display the results to the user. To display the error message, you can include it from your state just above your form. &lt;br&gt;
Don’t worry, it will be displayed only when &lt;em&gt;error&lt;/em&gt; has a non-empty value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loan Calculator&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleSubmitValues&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Section 10
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Recalculate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Great job! You finished your loan calculator! 🤝&lt;br&gt;
Now it’s time to get the application ready to be used again.&lt;/p&gt;

&lt;p&gt;We need to include a button in the form that displays the results and call a function to clear the fields like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Calculate again'&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'button'&lt;/span&gt;
  &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;clearFields&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clearing the fields is really simple. We just need to set all the user-provided values in state to empty strings again and change &lt;em&gt;isResult&lt;/em&gt; to false like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;clearFields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nf"&gt;setUserValues&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
     &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;interest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nf"&gt;setResults&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
     &lt;span class="na"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;totalPayment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;totalInterest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;isResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
 &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! Very well done! 👏&lt;/p&gt;

&lt;p&gt;Now you know a little more how to create forms, handle validation, manipulate data, and work with event handlers.&lt;/p&gt;

&lt;p&gt;There are lots to do from here. You can play around with more kinds of calculations and validations, or maybe you want to include a UI library. There is much more to discover...&lt;/p&gt;

&lt;p&gt;Believe me, this is just the beginning and this is the way!&lt;/p&gt;

&lt;p&gt;Happy coding! 🖖&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
