<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: John Ekunola O.</title>
    <description>The latest articles on Forem by John Ekunola O. (@jizzyjay).</description>
    <link>https://forem.com/jizzyjay</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%2F731425%2Fa4fe9132-9da1-4043-8d14-f0d961b57884.jpeg</url>
      <title>Forem: John Ekunola O.</title>
      <link>https://forem.com/jizzyjay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jizzyjay"/>
    <language>en</language>
    <item>
      <title>Implementing Counter App</title>
      <dc:creator>John Ekunola O.</dc:creator>
      <pubDate>Tue, 10 Jan 2023 18:54:44 +0000</pubDate>
      <link>https://forem.com/jizzyjay/implementing-counter-app-4k8p</link>
      <guid>https://forem.com/jizzyjay/implementing-counter-app-4k8p</guid>
      <description>&lt;p&gt;React.js, more commonly known as React, it's a free open-source JavaScript library. The React.js framework library was developed by Facebook.&lt;/p&gt;

&lt;p&gt;In React, you develop your applications by creating reusable components. These components are individual pieces of a final interface, which, when assembled, form the application’s entire user interface. This makes React applications very easy to update and maintain.&lt;/p&gt;

&lt;p&gt;Requirements for Implementing a Counter App in React.js&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js installed&lt;/li&gt;
&lt;li&gt;Code editor&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Netlify&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our initial step in developing our counter application is to establish a new React.js project. There are numerous techniques to do this, though the most effortless option is to utilize the create-react-app tool. This tool sets up a new project along with the essential dependencies and configuration files, enabling us to rapidly start constructing our app. This is most certainly a commendable approach and we are certain that it will provide a smooth and successful implementation.&lt;/p&gt;

&lt;p&gt;To do this, simply run the below command in your terminal&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 my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will create an react app which you can run on your local server by running the below code.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Secondly, we will create a new file in our project called "useCounter.js". Within this file, we will define our custom hook by utilizing the useState hook to keep track of the current count. This hook will enable us to keep track of the count in our application, allowing us to update and manipulate the count as needed.&lt;br&gt;
&lt;/p&gt;

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

const useCounter = () =&amp;gt; {
  const ACTIONS = {
    ADD: "add",
    REDUCE: "reduce",
    RESET: "reset",
    SET_VALUE: "setValue",
  };

  function setValue(value, count) {
    let num = Number(value);
    if (String(num) === "NaN" || value === "") {
      return count;
    }
    return num;
  }

  function reducer(count, action) {
    switch (action.type) {
      case ACTIONS.SET_VALUE:
        return setValue(action.payload, count);
      case ACTIONS.ADD:
        return ++count;
      case ACTIONS.REDUCE:
        return --count;
      case ACTIONS.RESET:
        return 0;
      default:
        return count;
    }
  }
  const [count, dispatch] = useReducer(reducer, 0);

  return { count, dispatch, ACTIONS };
};
export default useCounter;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our custom hook is used to define the initial count to be 0 and provide four different functions to interact with the count: increment, decrement, reset, and setValue. The setCount function provided by useState is used to update the count accordingly. To make use of our custom hook, we will create a new component called “Counter” that will display the current count in the UI. This will allow us to easily keep track of the count and interact with it using the four functions provided in the custom hook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import useCounter from "./useCounter";
import "../Styles/Counter.css";
// import { Helmet } from "react-helmet-async";

export default function Counter() {
  const { count, dispatch, ACTIONS } = useCounter();

  return (
    &amp;lt;div&amp;gt;
{/* 
    &amp;lt;Helmet&amp;gt;
      &amp;lt;title&amp;gt;Counter&amp;lt;/title&amp;gt;
      &amp;lt;meta name="description" content="Counter page" /&amp;gt;
    &amp;lt;/Helmet&amp;gt; */}
      &amp;lt;div className="counter-container"&amp;gt;
        &amp;lt;input
          type="text"
          placeholder="Count Value"
          onChange={(e) =&amp;gt;
            dispatch({ type: ACTIONS.SET_VALUE, payload: e.target.value })
          }
        /&amp;gt;
        &amp;lt;h2&amp;gt;Count : {count}&amp;lt;/h2&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;button
            className="add-btn"
            onClick={() =&amp;gt; {
              dispatch({ type: ACTIONS.ADD });
            }}
          &amp;gt;
            Increase
          &amp;lt;/button&amp;gt;
          &amp;lt;button
            className="dlt-btn"
            onClick={() =&amp;gt; {
              dispatch({ type: ACTIONS.REDUCE });
            }}
          &amp;gt;
            Decrease
          &amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;

        &amp;lt;button
          onClick={() =&amp;gt; {
            dispatch({ type: ACTIONS.RESET });
          }}
        &amp;gt;
          Reset
        &amp;lt;/button&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the core functionality was established, we moved on to styling the application. We employed CSS to provide the app with a distinct look and feel, and we were able to customize the appearance to our exact specifications. The appropriate CSS class and import have already been implemented in the code.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Overall, the process of constructing a counter app with React.js was an immensely rewarding experience. Despite the occasional roadblock, we were able to surmount them and create a fully functional and aesthetically pleasing program.&lt;/p&gt;

&lt;p&gt;Github Url: &lt;a href="https://github.com/Jizzyjay/AltSchool-Second-Exam"&gt;https://github.com/Jizzyjay/AltSchool-Second-Exam&lt;/a&gt;&lt;br&gt;
Netlify Url: &lt;a href="https://altexam.netlify.app/"&gt;https://altexam.netlify.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React and ReactDom</title>
      <dc:creator>John Ekunola O.</dc:creator>
      <pubDate>Tue, 04 Oct 2022 14:20:03 +0000</pubDate>
      <link>https://forem.com/jizzyjay/react-and-reactdom-2a4h</link>
      <guid>https://forem.com/jizzyjay/react-and-reactdom-2a4h</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is React.js?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React.js, more commonly known as React, it's a free open-source JavaScript library. The React.js framework library was developed by Facebook.&lt;/p&gt;

&lt;p&gt;In React, you develop your applications by creating reusable components. These components are individual pieces of a final interface, which, when assembled, form the application’s entire user interface. This makes React applications very easy to update and maintain.&lt;/p&gt;

&lt;p&gt;The important features of ReactJS are as follows.&lt;/p&gt;

&lt;p&gt;JSX&lt;br&gt;
Components&lt;br&gt;
One-way Data Binding&lt;br&gt;
Virtual DOM&lt;br&gt;
Simplicity&lt;br&gt;
Performance&lt;br&gt;
JSX&lt;br&gt;
JSX stands for JavaScript XML. It is a JavaScript syntax extension. It's an XML or HTML like syntax used by ReactJS. This syntax is processed into JavaScript calls of React Framework. It extends the ES6 so that HTML-like text can co-exist with JavaScript react code. It is not necessary to use JSX, but it's recommended to use in ReactJS.'&lt;/p&gt;

&lt;p&gt;Example of a JSX code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`render(){
    return(
      &amp;lt;div&amp;gt;
        &amp;lt;h2&amp;gt;Hello AltSchool&amp;lt;/h2&amp;gt;
      &amp;lt;/div&amp;gt;
    )
}`

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Components&lt;/strong&gt;&lt;br&gt;
ReactJS is all about components. ReactJS applications are made up of multiple components, and each component has its logic and controls. These components can be reused, which helps you to maintain the code when working on large-scale projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Virtual DOM&lt;/strong&gt;&lt;br&gt;
A virtual DOM object is a representation of the original DOM object. It works like a one-way data binding. Whenever any modifications happen in the web application, the entire UI is re-rendered in virtual DOM representation. Then it checks the difference between the previous DOM representation and the new DOM. Once it has been done, the real DOM will update only the things that have changed. This makes the application faster, and there is no waste of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplicity&lt;/strong&gt;&lt;br&gt;
ReactJS uses JSX files which makes the application simple and to code as well as understand. JSX files are HTML files with embedded JavaScript. This makes the code more readable and easier to understand.&lt;/p&gt;

&lt;p&gt;ReactJS is a component-based approach that makes the code reusable as your need it. This makes it simple to use and learn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;br&gt;
ReactJS is known to be a great performer. This feature makes it much better than other frameworks out there today. The reason behind this is that it manages a virtual DOM. The DOM is a cross-platform and programming API that deals with HTML, XML, or XHTML. The DOM exists entirely in memory. Due to this, when we create a component, we did not write directly to the DOM. Instead, we are writing virtual components that will turn into the DOM leading to smoother and faster performance.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What is DOM? *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;DOM, abbreviated as Document Object Model, is a World Wide Web Consortium standard logical representation of any webpage. In easier words, DOM is a tree-like structure that contains all the elements and it’s properties of a website as its nodes. DOM provides a language-neutral interface that allows accessing and updating of the content of any element of a webpage. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What is ReactDOM? *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ReactDOM is a package that provides DOM-specific methods that can be used at the top level of a web app to enable an efficient way of managing DOM elements of the web page. ReactDOM provides the developers with an API containing the following methods and a few more. &lt;br&gt;
render()&lt;br&gt;
findDOMNode()&lt;br&gt;
unmountComponentAtNode()&lt;br&gt;
hydrate()&lt;br&gt;
createPortal()&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should I Learn React JS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React is quickly shaping into one of the most popular and in-demand JavaScript libraries. Therefore, the demand for React developers is very high. As a result, there is a wide range of jobs for developers who know how to use React.&lt;/p&gt;

&lt;p&gt;Overall, the demand for React developers is high, and the range of jobs is wide. If you are a React developer, you should be able to find a job that fits your skills and interests.&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
      <category>reactdom</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Lessons learnt so far in my programming Journey</title>
      <dc:creator>John Ekunola O.</dc:creator>
      <pubDate>Sat, 11 Jun 2022 18:40:07 +0000</pubDate>
      <link>https://forem.com/jizzyjay/lessons-learnt-so-far-in-my-programming-journey-1a59</link>
      <guid>https://forem.com/jizzyjay/lessons-learnt-so-far-in-my-programming-journey-1a59</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;The journey of a thousand miles begins with one step.&lt;br&gt;
--Lao Tzu.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learning or achieving anything begins with just taking the first step. Taking the first step marks the beginning of a new direction/journey.&lt;/p&gt;

&lt;p&gt;These are some of the lessons I've learned and still learning:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set a goal &amp;amp; move towards it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;“Goal setting is massively individual, it’s about checking in with yourself and being really honest about what you want and what your motivations are” — Katerina Georgiou, Technical Coach @ Maker’s.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Setting a goal can be a powerful, motivational booster on your path to learning to code. &lt;br&gt;
There is no end to learning and improvement in programming, and that’s why it is a good idea to keep setting goals, not lose track of your primary goal, and also help you to be accountable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You must always be open to Learning:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a journey of never-ending learning, there is no end to improvement. we are always upgrading our skills to meet the latest market requirement. As a beginner, you should always be ready to learn new things.&lt;br&gt;
So, what can you take away from this? It is okay to not know everything. As long as you never stop learning new things, you’ll be fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More doing, Less Watching:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Watching along with a coding tutorial is great for starting out. You may learn a little when watching a code along but you actually learn more by doing.&lt;/p&gt;

&lt;p&gt;A better way to learn to code build a project by yourself. Just get started. Write your own code, solve the bugs, read documentation, and use other resources like StackOverflow, google.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t compare your journey with anyone else’s:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's very important to know your journey is different from any other person's journey, so it will do you more good than bad to focus on yours and continue grinding. &lt;br&gt;
Comparing your own personal journeys with others often leads to discouragement. The only person you are in competition with is you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's okay to be frustrated:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Being frustrated is very much okay and it's part of the experience. It's okay to take a step back if things aren't going your way at a point in time.&lt;/p&gt;

&lt;p&gt;It’s okay to hate it sometimes, it’s okay to ask for help, and it's okay to take your mind off that problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google is your Friend:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Knowing how to google is one of the most important skills for a developer.&lt;br&gt;
Becoming a great developer takes a lot of learning to achieve and more often we get stuck on a particular problem or bug. So it's essential to develop your googling skills.&lt;/p&gt;

&lt;p&gt;The problem you are facing especially as a beginner in most cases has a solution and it's just a Google search away. This will help improve your googling skills.&lt;/p&gt;

&lt;p&gt;Learning new things in general is a big task and as much takes a lot of dedication, energy, and input to achieve. I hope these few above-mentioned points will help you with this journey you've started.&lt;br&gt;
Wishing you all the best as we journey together and i can't wait to see you at the top.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>career</category>
    </item>
  </channel>
</rss>
