<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Damilola Esan on Medium]]></title>
        <description><![CDATA[Stories by Damilola Esan on Medium]]></description>
        <link>https://medium.com/@ionikdev?source=rss-d8d0c736f734------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wPovSHnYAQeRKpD4UQua2w.jpeg</url>
            <title>Stories by Damilola Esan on Medium</title>
            <link>https://medium.com/@ionikdev?source=rss-d8d0c736f734------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 06:14:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ionikdev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Axios: A Simple and Effective Way to Make API Calls in React with TypeScript]]></title>
            <link>https://javascript.plainenglish.io/axios-a-simple-and-effective-way-to-make-api-calls-in-react-with-typescript-f0b1e7eebdc5?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0b1e7eebdc5</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[postman]]></category>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Thu, 09 Nov 2023 08:16:42 GMT</pubDate>
            <atom:updated>2023-11-09T08:16:42.666Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn How to Configure, Use, and Optimize Axios in Your React Projects with TypeScript: A Guide to Handling HTTP Requests with Ease and Efficiency</h4><figure><img alt="Learn How to Configure, Use, and Optimize Axios in Your React Projects with TypeScript: A Guide to Handling HTTP Requests with Ease and Efficiency" src="https://cdn-images-1.medium.com/max/1024/0*_kEJylOc8c9JbnYs" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">Sigmund</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Have you ever wondered how to make your React app communicate with the internet and fetch the data it needs? If you’re like most developers, you probably have used tools like Fetch or React Query, but did you know that there is another option that is gaining popularity among developers: Axios? Axios is a JavaScript library that simplifies making HTTP requests from your browser or Node.js server. It was created by Matt Zabriskie in 2014 and has over 10,800 stars on GitHub. Axios offers many advantages over other tools, such as easy configuration, automatic JSON parsing, error handling, and TypeScript support. In fact, Axios is one of the most popular libraries for making API calls in React with TypeScript, according to a survey by Stack Overflow. In this guide, I will show you how to set up Axios in your React app with TypeScript and use it to make API calls with ease. I will also share some practical approaches and best practices to help you get the most out of Axios in your projects. By the end of this guide, you’ll be able to:</p><ol><li>Configure Axios in your React app with TypeScript and customize its settings.</li><li>Handle errors and exceptions gracefully with Axios</li><li>Optimize your API calls with Axios by using interceptors, cancel tokens, and timeouts.</li><li>Apply some of the best practices and tips for using Axios in your React projects with TypeScript.</li></ol><h3>Prerequisites</h3><p><em>Before diving into the world of Axios and React, ensure that you have the following prerequisites in place:</em></p><ul><li><strong><em>A working knowledge of React and TypeScript</em></strong><em>. You should be familiar with the basic concepts and syntax of React, such as components, props, state, hooks, and JSX. You should also be comfortable with TypeScript, a superset of JavaScript that adds static types and other features. TypeScript helps you write more robust and maintainable code, especially when working with complex data structures and APIs. If you need a refresher on React or TypeScript, you can check out these resources:</em></li><li><a href="https://react.dev/learn"><em>React — A JavaScript library for building user interfaces.</em></a></li><li><a href="https://www.typescriptlang.org/"><em>TypeScript — JavaScript with syntax for types</em></a></li><li><strong><em>A React project set up</em></strong><em>, preferably using any library/framework. You can use any tool or framework that you prefer to create and run your React app, such as Create React App, Next.js, Gatsby, or Vite. In this guide, we’ll be using Vite, a fast and lightweight tool that helps you set up a React project with TypeScript in minutes. You can learn more about Vite and how to install it here:</em></li><li><a href="https://vitejs.dev/guide/"><em>Vite — A faster frontend build tool</em></a></li></ul><h3>Step 1: Installing Axios</h3><p>Our journey begins with the installation of Axios. This is a crucial step, as Axios is the library that simplifies HTTP requests within your application. Axios is a JavaScript library that allows you to make HTTP requests from your browser or Node.js server. It supports both the Promise and async/await syntax, which makes your code more readable and maintainable. Axios also has many features that make it ideal for working with APIs, such as easy configuration, automatic JSON parsing, error handling, and TypeScript support. You can use Axios to make requests to any API endpoint, such as RESTful, GraphQL, or Firebase. In this guide, we’ll be using Axios to make requests to Dog API, a free and open-source API that provides random images and facts about dogs. You can learn more about the Dog API here:</p><ul><li><a href="https://dog.ceo/dog-api/"><em>Dog API — The internet’s biggest collection of open-source dog pictures</em></a></li></ul><p>To <strong>install Axios</strong>, open your terminal and run either of the following commands, depending on your package manager:</p><pre>npm install axios<br># or<br>yarn add axios</pre><p><em>Here is a screenshot of the React project that I created. You can see that I have Axios installed in my package. Json file.</em></p><figure><img alt="create vite app, axios," src="https://cdn-images-1.medium.com/max/1024/1*PI0hqO0YrYbqIkx37Q-6cg.png" /><figcaption>image by the author</figcaption></figure><h3>Step 2: Creating an Axios Instance</h3><p>Creating an Axios Instance Axios instances provide a convenient way to manage global configurations for your requests. An Axios instance is an object that has all the methods and properties of the Axios library, but with some custom settings that apply to all the requests made with that instance. For example, you can set the base URL, the request headers, the timeout, and the error handling for your instance. This way, you don’t have to repeat these settings for each request, and you can keep your code more organized and consistent. To create an Axios instance, follow these steps:</p><ul><li>Create a file in your src folder, then create another folder and call it services. You can name it whatever you want, but this step is just for a good file structure.</li><li>Inside the services folder, create a file called axiosInstance.ts. This is where you will define and export your Axios instance.</li><li>Inside the axiosInstance.ts file, write the following code:</li></ul><pre><br>import axios, { AxiosInstance, AxiosError, AxiosResponse } from &quot;axios&quot;;<br><br>const axiosClient = (token: string | null = null): AxiosInstance =&gt; {<br>  const headers = token<br>    ? {<br>        Authorization: `Bearer ${token}`,<br>        &quot;Content-Type&quot;: &quot;multipart/form-data&quot;,<br>      }<br>    : {<br>        &quot;Content-Type&quot;: &quot;multipart/form-data&quot;,<br>      };<br><br>  const client = axios.create({<br>    baseURL: &quot;https://dog.ceo/api&quot;,<br>    headers,<br>    timeout: 60000,<br>    withCredentials: false,<br>  });<br><br>  client.interceptors.request.use((config: any) =&gt; {<br>    const token = localStorage.getItem(&quot;ACCESS_TOKEN&quot;);<br>    config.headers = config.headers || {};<br>    if (token) {<br>      config.headers.Authorization = `Bearer ${token}`;<br>    }<br>    return config;<br>  });<br><br>  client.interceptors.response.use(<br>    (response: AxiosResponse) =&gt; {<br>      return response;<br>    },<br>    (error: AxiosError) =&gt; {<br>      try {<br>        const { response } = error;<br>        if (response?.status === 401) {<br>          localStorage.removeItem(&quot;ACCESS_TOKEN&quot;);<br>        }<br>      } catch (e) {<br>        console.error(e);<br>      }<br>      throw error;<br>    }<br>  );<br><br>  return client;<br>};<br><br>export default axiosClient;</pre><p>The code above creates and configures an axios instance with TypeScript, which you can use to make HTTP requests to the Dog API. The axios instance has some custom settings that apply to all the requests made with it, such as the base URL, the headers, the timeout, and the error handling. You can also use the axiosClient function to create the instance with a token, if you need authentication with the API.</p><p>You don’t have to worry about the details of the code, as axios will handle the requests for you. However, if you want to learn more about how the code works and what each line does, you can read the comments and explanations below the code. They will help you understand the logic and the syntax of the code.</p><p>If you are not interested in the code, you can just skip to the next step, where I will show you how to use the axios instance to make API calls. You will see how easy and convenient it is to use axios with React and TypeScript.</p><pre>import axios, { AxiosInstance, AxiosError, AxiosResponse } from “axios”;<br><br>// First, you import axios and some of its types from the axios library,<br>// AxiosInstance is the type for the axios instance object<br>// AxiosError is the type for the error object that you get when a request fails <br>// AxiosResponse is the type for the response object that you get when a request succeeds</pre><pre>const axiosClient = (token: string | null = null): AxiosInstance =&gt; { <br>// Next, you define a function called axiosClient that creates and returns an axios instance<br>// The function takes an optional parameter called token, which is either a string or null<br>// The token is used for authentication with the API, if needed <br>// The function returns an axios instance, which is of type AxiosInstance</pre><pre>const headers = token ? { Authorization: Bearer ${token}, “Content-Type”: “multipart/form-data”, } <br>: { “Content-Type”: “multipart/form-data”, };<br><br>// Then, you define a constant called headers, which is an object that contains the headers for the requests<br>// The headers object depends on whether the token is provided or not<br>// If the token is provided, the headers object has two properties: Authorization and Content-Type<br>// The Authorization property has the value of Bearer ${token}, which is a string that contains the token with the Bearer prefix<br>// The Bearer prefix is a convention that indicates the type of authentication scheme <br>// The Content-Type property has the value of “multipart/form-data”, which is a string that indicates the type of data that is sent with the request <br>// If the token is not provided, the headers object only has one property: Content-Type, with the same value as before</pre><pre>const client = axios.create({ baseURL: “https://dog.ceo/api”, headers, timeout: 60000, withCredentials: false, });<br><br>// After that, you define a constant called client, which is the axios instance that you create using the axios.create method<br>// The axios.create method takes an object as an argument, which contains some options for the instance<br>// The options that you use are:<br>// - baseURL: The base URL for the requests, which is the Dog API in this case<br>// - headers: The headers object that you defined earlier<br>// - timeout: The maximum time in milliseconds that the request can take<br>// - withCredentials: A boolean that indicates whether to send cookies with the request</pre><pre>client.interceptors.request.use((config: any) =&gt; { <br>// Next, you add a request interceptor to the client instance using the client.interceptors.request.use method<br>// A request interceptor is a function that runs before each request and modifies or handles the request in some way<br>// The client.interceptors.request.use method takes two arguments: a function that runs on success and a function that runs on error<br>// In this case, you only use the first argument, which is a function that takes a config parameter and returns the modified config object<br>// The config parameter is an object that contains the request configuration, such as the url, the method, the data, and the headers <br>// The config object is what axios uses to make the request</pre><pre>const token = localStorage.getItem(&quot;ACCESS_TOKEN&quot;);<br>// Inside the function, you get the token from the local storage using the localStorage.getItem method<br>// The local storage is a browser feature that allows you to store data in the browser<br>// The data is stored as key-value pairs, where the key is a string and the value is also a string<br>// In this case, the key is &quot;ACCESS_TOKEN&quot; and the value is the token<br>// The localStorage.getItem method takes the key as an argument and returns the value as a string or null<br><br>config.headers = config.headers || {};<br>if (token) {<br>  config.headers.Authorization = `Bearer ${token}`;<br>}<br>// Then, you set the headers for the config object using the config.headers property<br>// The config.headers property is an object that contains the headers for the request<br>// You use the || operator to make sure that the config.headers object exists, or create an empty object if it doesn&#39;t<br>// Then, you check if the token exists using an if statement<br>// If the token exists, you set the Authorization property of the config.headers object to `Bearer ${token}`, which is the same as the headers object that you defined earlier<br>// This way, you add the token to the request header, if it exists<br><br>return config;<br>// Finally, you return the modified config object, which will be used by axios to make the request<br>});</pre><pre>client.interceptors.response.use( (response: AxiosResponse) =&gt; {<br> // Next, you add a response interceptor to the client instance using the client.interceptors.response.use method<br> // A response interceptor is a function that runs after each response and modifies or handles the response in some way<br> // The client.interceptors.response.use method takes two arguments: a function that runs on success and a function that runs on error<br> // In this case, you use both arguments, which are functions that take a response parameter and return the modified response object<br> // The response parameter is an object that contains the response data, such as the status, the data, and the headers<br> // The response object is what axios returns to you when the request succeeds or fails<br><br>  return response;<br>  // Inside the first function, which runs on success, you just return the response object as it is<br>  // You don&#39;t need to modify or handle the response in any way, because you are happy with the default behavior of axios<br>},<br>(error: AxiosError) =&gt; {<br>  // Inside the second function, which runs on error, you handle the error response in some way<br>  // The error parameter is an object that contains some information about the error, such as the message, the code, and the response<br>  // The error object is what axios returns to you when the request fails<br>  // The error.response property is the same as the response object in the success case, but it also has a status property that indicates the HTTP status code<br>  // You can use the status property to handle different types of errors<br><br>  try {<br>    const { response } = error;<br>    if (response?.status === 401) {<br>      localStorage.removeItem(&quot;ACCESS_TOKEN&quot;);<br>    }<br>  } catch (e) {<br>    console.error(e);<br>  }<br>  // In this case, you use a try-catch block to handle the error response<br>  // The try-catch block allows you to execute some code and catch any errors that occur<br>  // Inside the try block, you write the code that you want to execute<br>  // Inside the catch block, you write the code that you want to execute when an error occurs<br>  // In this case, you only write code inside the try block, because you don&#39;t need to do anything else when an error occurs<br>  // Inside the try block, you do the following:<br>  // - You destructure the response property from the error object using the const { response } = error syntax<br>  // - You check if the response exists and if the status is 401 using the response?.status === 401 syntax<br>  // - The response?.status syntax is called optional chaining, which allows you to access a property of an object that may be undefined or null<br>  // - If the response exists and the status is 401, it means that the request was unauthorized, and the token was invalid or expired<br>  // - In that case, you remove the token from the local storage using the localStorage.removeItem method<br>  // - The localStorage.removeItem method takes the key as an argument and removes the key-value pair from the local storage<br>  // - In this case, the key is &quot;ACCESS_TOKEN&quot; and the value is the token<br><br>  throw error;<br>  // Finally, you throw the error object, which means that you re-throw the error to the caller of the axios instance<br>  // This way, you can handle the error in the component that uses the axios instance, such as showing an error message or retrying the request<br>}<br>);<br><br>// After adding the interceptors, you return the client object, which is the axios instance that you created and configured return client; };<br><br>export default axiosClient; // At the end of the file, you export the axiosClient function as the default export, which means that you can import it in other files without using curly braces</pre><h3>Step 3: Making a GET Request</h3><p>Making a GET Request Now, let’s put Axios to work and make our first API call. We’ll use the GET method, which is the most common and simple way to fetch data from an API. The GET method requests a resource from a server, such as a web page, an image, or a JSON file. The server responds with the resource, or an error message if something goes wrong.</p><p>To test our API call, we’ll use Postman, a popular tool that helps you create and test API requests. You can download Postman for free from their website: <a href="https://www.postman.com/downloads/">Postman — API Development Platform</a>. Postman has a user-friendly interface that allows you to enter the URL, the method, the headers, and the parameters of your request, and see the response in different formats, such as JSON, HTML, or XML.</p><p>To make a <strong>GET request</strong> to the <strong>Dog API </strong>using <strong>Postman</strong>, follow these steps:</p><ul><li>Open Postman and create a new request by clicking on the plus (+) sign in the top left corner.</li><li>In the request tab, select GET as the method from the drop-down menu next to the URL field.</li><li>In the URL field, enter the following URL: <a href="https://dog.ceo/api/breed/hound/images.">https://dog.ceo/api/breed/hound/images.</a> This is the endpoint for getting random images of hound dogs from the Dog API.</li><li>Click on the Send button to send the request to the server.</li><li>In the response section, you should see a status code of 200, which means that the request was successful, and a JSON object that contains the response data. The JSON object has two properties: status and message. The status property has the value of “success”, which indicates that the request was successful. The message property has the value of an array of strings, which are the URLs of the dog images. You can also see the images in the Visualize tab, which shows a preview of the images.</li></ul><p>Here is a screenshot of how the Postman interface looks like after making the GET request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgsvdCgoN3hnodnLbxnw-Q.png" /><figcaption>image by the author</figcaption></figure><p>As you can see, making a GET request with Postman is very easy and convenient. However, we want to make the request from our React app, not from Postman. How can we do that? That’s where Axios comes in. Axios allows us to make the same request from our React app with just a few lines of code. Here is how we can do it:</p><pre>import React, { useState, useEffect } from &quot;react&quot;;<br>import &quot;./app.css&quot;;<br>import axiosClient from &quot;./services/AxiosInstance&quot;;<br><br>const App: React.FC = () =&gt; {<br>  const client = axiosClient();<br>  const [dogs, setDogs] = useState&lt;string[]&gt;([]);<br>  useEffect(() =&gt; {<br>    client<br>      .get(&quot;/breed/hound/images&quot;)<br>      .then((response) =&gt; {<br>        setDogs(response.data.message);<br>      })<br>      .catch((error) =&gt; {<br>        console.error(&quot;Error fetching dog images:&quot;, error);<br>      });<br>  }, []);<br>  return (<br>    &lt;&gt;<br>      &lt;h1 className=&quot;page-title&quot;&gt;Thank You For Reading 😇&lt;/h1&gt;<br>      &lt;div className=&quot;dog-card-container&quot;&gt;<br>        {dogs.map((dog, index) =&gt; (<br>          &lt;div key={index} className=&quot;dog-card&quot;&gt;<br>            &lt;div className=&quot;dog-label&quot;&gt;Dog&lt;/div&gt;<br>            &lt;img src={dog} alt={&quot;dog&quot;} /&gt;<br>          &lt;/div&gt;<br>        ))}<br>      &lt;/div&gt;<br>    &lt;/&gt;<br>  );<br>};<br><br>export default App;</pre><p>The code above shows how to make a GET request with Axios in your React app. A GET request is a way to fetch data from an API, such as the Dog API. The code uses the axiosClient function that we created before, which returns an axios instance with some custom settings. The code also uses React hooks to create and update the state variable that stores the data, and to fetch the data when the component mounts.</p><p>You don’t have to understand every detail of the code, as the main idea is to use the client.get method and pass the URL of the endpoint. Axios will handle the rest for you, and you can use the response object to update your state and render your app.</p><p>However, if you want to learn more about the code, you can read the comments and explanations below the code.</p><p>If you are not interested in the code, you can skip to the next section.</p><h3><strong>Explanation</strong></h3><ol><li><strong><em>In our React app</em></strong><em>, open the App.tsx file, which is the main component of our app.</em></li><li><strong><em>At the top of the file</em></strong><em>, import React, useState, useEffect, and the axiosClient function that we created in the previous step. We’ll use these to create and render our app.</em></li><li><strong><em>Inside the App component</em></strong><em>, define a constant called client, which is the axios instance that we create by calling the axiosClient function. We don’t need to pass any token to the function, because the Dog API doesn’t require authentication.</em></li><li><strong><em>Define a state variable called dogs</em></strong><em>, which is an array of strings that will store the URLs of the dog images. We’ll use the useState hook to create and update the state variable. We’ll initialize the state variable with an empty array, as we don’t have any data yet.</em></li><li><strong><em>Define a side effect </em></strong><em>that will run once when the component mounts, and fetch the data from the API. We’ll use the useEffect hook to create the side effect. We’ll pass an empty array as the second argument to the hook, to indicate that the effect has no dependencies and should only run once.</em></li><li><strong><em>Inside the effect</em></strong><em>, use the client.get method to make a GET request to the same URL that we used in Postman: /breed/hound/images. The client.get method takes the URL as an argument and returns a promise that resolves to the response object. We’ll use the then and catch methods to handle the promise.</em></li><li><strong><em>Inside the effect</em></strong><em>, use the client.get method to make a GET request to the same URL that we used in Postman: /breed/hound/images. The client.get method takes the URL as an argument and returns a promise that resolves to the response object. We’ll use the then and catch methods to handle the promise.</em></li><li><strong><em>Inside the then method</em></strong><em>, use the setDogs function to update the state variable with the data from the response. The response object has a data property, which contains the JSON object that we saw in Postman. The JSON object has a message property, which contains the array of URLs that we want. We’ll pass the response.data.message array to the setDogs function, which will update the state variable with the new data.</em></li><li><strong><em>Inside the catch method</em></strong><em>, use the console.error method to log the error to the console. The error object has a message property, which contains the error message that we get from the server or from axios. We’ll pass the error object to the console.error method, which will print it to the console with a red color and an error icon. This is useful for debugging purposes, but you can also do something else with the error, such as showing a message to the user or reporting it to a service.</em></li><li><em>Return a JSX element that renders the app. We’ll use a fragment, which is a way to group multiple elements without adding extra nodes to the DOM. We’ll use the &lt;&gt; and &lt;/&gt; syntax to create the fragment.</em></li><li><em>Inside the fragment, add a heading element that displays the title of the app. We’ll use the h1 element and give it a class name of “page-title”.</em></li><li><em>Add a div element that displays the dog images in a grid. We’ll use the div element and give it a class name of “dog-card-container”. We’ll use the map method to iterate over the dogs array and create a div element for each dog image. We’ll use the key prop to assign a unique key to each element, which is required by React to identify the elements. We’ll use the index of the array as the key, but you can also use something else, such as the URL itself. We’ll give each div element a class name of “dog-card”, which will style the element as a card. We’ll also add a div element inside the card that displays the label “Dog”. We’ll give this div element a class name of “dog-label”, which will style the element as a label. We’ll also add an img element inside the card that displays the image. We’ll use the src prop to assign the URL of the image to the element, and the alt prop to assign an alternative text to the element, which is “dog” in this case.</em></li><li><em>Export the App component as the default export, which means that you can import it in other files without using curly braces.</em></li></ol><p>If you followed everything correctly, you should see something like this in your browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldr1zMSvUdzAj9jc4acyGw.png" /><figcaption>image by the author</figcaption></figure><p>This is the result of making a GET request with Axios in your React app. You can see the title of the app, and a grid of dog images that are fetched from the Dog API. You can also open the developer tools and see the console log of the response object and the error object, if any.</p><p>As you can see, making a GET request with Axios is very easy and convenient. You just need to use the client.get method and pass the URL of the endpoint. Axios will handle the rest for you, such as parsing the JSON data, handling the errors, and returning the response object. You can then use the response object to update your state and render your app.</p><p>You can also use the same approach to make other types of requests, such as POST, PUT, PATCH, or DELETE. You just need to use the corresponding method of the client object, such as client.post, client.put, client.patch, or client.delete. You can also pass some additional arguments to the method, such as the data, the params, or the config. For example, if you want to make a POST request to create a new dog breed, you can do something like this:</p><pre>client .post(&quot;/breed&quot;, { name: &quot;Husky&quot;, origin: &quot;Siberia&quot;, temperament: &quot;Friendly&quot;, }) <br>.then((response) =&gt; { console.log(&quot;Dog breed created:&quot;, response.data); }) <br>.catch((error) =&gt; { console.error(&quot;Error creating dog breed:&quot;, error); });</pre><p>You can learn more about the different methods and arguments of Axios in their documentation: <a href="https://axios-http.com/docs/intro">Axios</a> .</p><h3>Conclusion</h3><p>In this article, you learned how to use Axios, React, TypeScript, and Postman to make HTTP requests to any API endpoint. You learned how to create and configure an axios instance with TypeScript, how to use the axiosClient function to create the instance with a token, if needed, and how to add request and response interceptors to the instance. You learned how to use the client.get method to make a GET request to the Dog API, how to handle the response and the error, and how to update and render your state with React hooks. You also learned how to pass additional arguments the config.</p><p>You also learned how to test your API call with Postman, how to enter the URL, the method, the headers, and the parameters of your request, and how to see the response in JSON formats. You also learned how to use comments and explanations to understand the code better, and how to use markdown elements to present information in a visually appealing manner.</p><p>This article covered a lot of topics and concepts, but I hope you found it useful and interesting. If you have any questions, feedback, or suggestions, please leave a comment below. I would love to hear from you and help you with your queries. If you liked this article, please share it with your friends and colleagues, and don’t forget to follow me twitter <a href="https://twitter.com/ionikdev">@ionikdev</a> and also on medium <a href="https://medium.com/u/d8d0c736f734">Damilola Esan</a> for more articles like this. Thank you for reading! 😊</p><h3>Relevant References:</h3><ol><li><a href="https://react.dev/learn">Quick Start — React</a></li><li><a href="https://www.typescriptlang.org/">TypeScript: JavaScript With Syntax For Types. (typescriptlang.org)</a></li><li><a href="https://vitejs.dev/guide/">Getting Started | Vite (vitejs.dev)</a></li><li><a href="https://axios-http.com/docs/intro">Getting Started | Axios Docs (axios-http.com)</a></li><li><a href="https://dog.ceo/dog-api/">Dog API</a></li><li><a href="https://www.postman.com/product/what-is-postman/">What is Postman? Postman API Platform</a></li></ol><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, <a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li><li><em>Check out our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a>, <a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a>, <a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0b1e7eebdc5" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/axios-a-simple-and-effective-way-to-make-api-calls-in-react-with-typescript-f0b1e7eebdc5">Axios: A Simple and Effective Way to Make API Calls in React with TypeScript</a> was originally published in <a href="https://javascript.plainenglish.io">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Solution for Redux State Hydration Issues When Using localStorage with Next.js]]></title>
            <link>https://medium.com/@ionikdev/a-simple-solution-for-redux-state-hydration-issues-when-using-localstorage-with-next-js-890d0e0343df?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/890d0e0343df</guid>
            <category><![CDATA[hydration]]></category>
            <category><![CDATA[localstorage]]></category>
            <category><![CDATA[redux-toolkit]]></category>
            <category><![CDATA[error]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 09:48:26 GMT</pubDate>
            <atom:updated>2023-10-23T10:19:07.025Z</atom:updated>
            <content:encoded><![CDATA[<p>You will learn why localStorage can cause issues with Redux state hydration and how to avoid them with a simple solution.</p><figure><img alt="Unhandled Runtime Error, Error: Hydration failed because the initial UI does not match what was rendered on the server" src="https://cdn-images-1.medium.com/max/1024/1*iCDeE8w9cPJ-y_nhs8R_OQ.png" /><figcaption>nextjs.org</figcaption></figure><h3>Introduction</h3><p>In the realm of web development, Next.js stands out as a robust framework renowned for its seamless server-side rendering (SSR) capabilities. It excels in serving pre-rendered content optimized for search engines and initial load performance, making it a game-changer in modern web application development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZ8-QOxA7Qhno8r-6nbElA.png" /><figcaption>Image by author: How Server-Side Rendering works</figcaption></figure><p>However, even within the Next.js ecosystem, challenges emerge when delving into client-side data persistence, especially when leveraging localStorage. This versatile browser-based storage mechanism offers a convenient means of saving and retrieving data on the client-side. Yet, when you introduce Redux — a state management library celebrated for its predictability and global state management — complexities may arise.</p><p>You might wonder: Why does Redux state hydration become a concern when dealing with localStorage? To understand this, we must acknowledge a fundamental distinction between the server and the browser: the absence of localStorage in the server environment.</p><p>When a Next.js application initially renders on the server, it operates in a controlled environment where localStorage is inaccessible. This necessitates data retrieval from localStorage on the client-side, presenting a significant challenge — how to ensure Redux state consistency when the server-rendered page first loads.</p><p>In this article, we will delve into the concept of hydration in detail, elucidating its significance within the Next.js context. We’ll explore how Redux fits into this scenario and, most importantly, how to effectively resolve and manage Redux state hydration errors. By the end, you’ll possess a clear roadmap to navigate these intricacies and deliver a seamless user experience in your Next.js applications.</p><h3>Understanding Hydration in the Context of Redux and localStorage</h3><p>Before delving into the intricacies of resolving Redux state hydration issues when accessing data from localStorage in Next.js, let’s start with a fundamental concept: hydration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BqVTg2ROLrQHGJEpzqJog.png" /></figure><p>Hydration is the process that bridges the gap between a server-rendered page and its transformation into an interactive client-side application. Think of it as the transition from a static webpage to a dynamic one.</p><p>When a Next.js application initially loads on the server, it pre-renders the page content to ensure a fast and SEO-friendly experience. However, this pre-rendered content is static, lacking the dynamic functionality associated with web applications.</p><p>Here’s where hydration comes into play. It’s the process of bringing that initial static page to life on the client-side. Hydration involves injecting JavaScript to add interactivity, enabling users to click buttons, submit forms, and experience all the dynamic features of your application.</p><p>Now, consider this in the context of our article. We’re delving into Redux state hydration, which means ensuring that the data managed by Redux, your global state manager, is properly rehydrated on the client-side. This becomes particularly crucial when dealing with data stored in localStorage.</p><p>In essence, Redux state hydration is the art of ensuring that when your Next.js application loads, the Redux state seamlessly adopts its previous state, without losing any essential data. It’s like reassembling all the puzzle pieces after transporting them from one place to another.</p><p>As we continue, keep this idea of hydration in mind. We’ll explore how to guarantee that your Redux state is effectively “refreshed” on the client-side, even when working with data from localStorage.</p><h3>Initial Approach: Using localStorage with Redux in Client-Side Rendered Apps</h3><p>In client-side-rendered applications built with tools like Vite or Create React App, a common requirement is to persist user-related data, ensuring it remains available even when users refresh the page. One way to achieve this is by utilizing the browser’s localStorage feature, a client-side storage solution.</p><pre>import { createSlice, PayloadAction } from &quot;@reduxjs/toolkit&quot;;<br><br>interface User {<br>  id: number;<br>  firstname: string;<br>  lastname: string;<br>  email: string;<br>  phone: string;<br>}<br><br>interface AuthState {<br>  user: User | null;<br>  token: string | null;<br>}<br><br>let userFromLocalStorage;<br><br>userFromLocalStorage = localStorage.getItem(&quot;user&quot;);<br><br>const storedUser = userFromLocalStorage<br>  ? JSON.parse(userFromLocalStorage)<br>  : null;<br><br>const initialState: AuthState = {<br>  user: storedUser || null,<br>  token: localStorage.getItem(&quot;access_token&quot;) || null,<br>};<br><br>const authSlice = createSlice({<br>  name: &quot;auth&quot;,<br>  initialState,<br>  reducers: {<br>    setUser: (state, action: PayloadAction&lt;User | null&gt;) =&gt; {<br>      state.user = action.payload;<br>      if (action.payload) {<br>        localStorage.setItem(&quot;user&quot;, JSON.stringify(action.payload));<br>      } else {<br>        localStorage.removeItem(&quot;user&quot;);<br>      }<br>    },<br>    setToken: (state, action: PayloadAction&lt;string | null&gt;) =&gt; {<br>      state.token = action.payload;<br>      if (action.payload) {<br>        localStorage.setItem(&quot;access_token&quot;, action.payload);<br>        console.log(&quot;Token set in local storage:&quot;, action.payload);<br>      } else {<br>        localStorage.removeItem(&quot;access_token&quot;);<br>      }<br>    },<br>  },<br>});<br><br>export const { setUser, setToken } = authSlice.actions;<br><br>export default authSlice.reducer;</pre><p>Now, when it comes to integrating localStorage with Redux, the initial approach appears straightforward. However, it’s crucial to understand that this method is tailored for client-side rendering (CSR) applications, where the entire application runs in the browser. In CSR apps, there’s no need to worry about the server-side environment because everything is managed in the browser.</p><p>In the provided code snippet, we begin by defining two vital interfaces: User and AuthState. These interfaces are used to structure our Redux store, with User representing user-related data, and AuthState containing various authentication-related properties.</p><p>This initial approach works seamlessly in CSR applications, allowing you to store and access data from localStorage without any issues. However, the story changes when you introduce server-side rendering (SSR) frameworks like Next.js into the mix.</p><p>In SSR environments, such as Next.js, a new challenge arises because the server, during the initial page render, doesn’t have access to the browser’s localStorage. It’s a client-side resource that doesn’t exist on the server.</p><p>This distinction becomes critical, as we’ll soon discover, because it leads to unexpected hydration errors when the server-rendered page transitions to the client-side. The next part of this article will delve into the specifics of why these errors occur and, more importantly, how to effectively address them while continuing to leverage localStorage within a Next.js application.</p><h3>Understanding Hydration Errors: Why They Occur</h3><p>These errors may manifest for various reasons, often related to the intricate balance between server-side rendering and client-side interactivity.</p><p>According to the official documentation, there are several common scenarios where hydration errors can arise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmqQiHYM2j1akqq4mt0J0g.png" /><figcaption>nextjs.org</figcaption></figure><p>In the context of this article, we are primarily concerned with “Using browser-only APIs like Window or localStorage in your rendering logic.” This is where the interaction with localStorage becomes crucial, and potential hydration issues arise.</p><p>For a visual representation of the kind of hydration error you may encounter when using localStorage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCDeE8w9cPJ-y_nhs8R_OQ.png" /><figcaption>nextjs.org</figcaption></figure><p>Now, let’s proceed to explore how to effectively handle these hydration errors in the context of localStorage within your Next.js application.</p><h3><strong>Solving Hydration Errors: Using useEffect and AuthInitializer Component</strong></h3><p>Now that we’ve identified the hydration error challenges associated with localStorage in server-side-rendered (SSR) frameworks like Next.js, let’s explore an effective solution. Our goal is to ensure that Redux state synchronization with localStorage occurs flawlessly.</p><p>To address this, we’ll utilize the power of React’s useEffect hook, a tool designed for handling side effects in functional components. However, we encounter a constraint – hooks, including useEffect, must be invoked inside functions that adhere to the rules of React hooks. Unfortunately, this rule prohibits us from using useEffect directly within our Redux authSlice.</p><p>So, how do we work around this limitation? The answer lies in creating a separate component, which we’ll call AuthInitializer. This component will serve as our gateway to effectively manage the synchronization of localStorage data with Redux.</p><p><strong>Here’s how it works:</strong></p><p><strong><em>Step 1</em></strong><em>: Set Initial State to null in authSlice</em></p><p>In our authSlice.ts, we initialize the state as null. This ensures that Redux starts with an empty state when the app initially loads, avoiding unnecessary conflicts during server-side rendering.</p><pre>const initialState: AuthState = {<br>  user: null,<br>  token: null,<br>  };</pre><p><strong><em>Step 2:</em></strong><em> Create the AuthInitializer Component</em></p><p>In a separate file, AuthInitializer.tsx , we create the AuthInitializer component. This component leverages useEffect to run client-side code for initializing Redux state.</p><pre>import React, { ReactNode, useEffect } from &quot;react&quot;;<br>import { useDispatch, useSelector } from &quot;react-redux&quot;;<br>import { RootState } from &quot;./store/store&quot;;<br>import { setToken, setUser } from &quot;./slices/authSlice&quot;;<br>import { User } from &quot;./types&quot;;<br><br>interface AuthInitializerProps {<br>  children: ReactNode;<br>}<br><br>const AuthInitializer: React.FC&lt;AuthInitializerProps&gt; = ({ children }) =&gt; {<br>  const dispatch = useDispatch();<br><br>  useEffect(() =&gt; {<br>    if (typeof window !== &quot;undefined&quot;) {<br>      const userFromLocalStorage = localStorage.getItem(&quot;user&quot;);<br>      const tokenFromLocalStorage = localStorage.getItem(&quot;access_token&quot;);<br><br>      if (userFromLocalStorage) {<br>        dispatch(setUser(JSON.parse(userFromLocalStorage) as User));<br>      }<br><br>      if (tokenFromLocalStorage) {<br>        dispatch(setToken(tokenFromLocalStorage));<br>      }<br>    }<br>  }, [dispatch]);<br><br>  return children;<br>};<br><br>export default AuthInitializer;</pre><p><strong><em>Step 3:</em></strong><em> Implement AuthInitializer</em></p><p>Finally, in your main application, wrap your components with the AuthInitializer component. This ensures that the useEffect within AuthInitializer runs when your application initializes, effectively synchronizing Redux state with localStorage on the client-side.</p><pre>import AuthInitializer from &quot;./AuthInitializer&quot;;<br><br>function App() {<br>  return (<br>    &lt;AuthInitializer&gt;<br>      {/* Your app components */}<br>    &lt;/AuthInitializer&gt;<br>  );<br>}</pre><p>By following this approach, we maintain compatibility with server-side rendering while effectively managing the synchronization of Redux state with localStorage on the client-side. This helps in eliminating the hydration errors you may encounter when accessing localStorage within a Next.js application.</p><h3><strong>Conclusion</strong></h3><p>In the realm of web development, challenges are an inherent part of the journey. Throughout this article, we’ve embarked on a guided exploration of the intricacies surrounding Redux state hydration in Next.js, especially when working with localStorage.</p><p>By harnessing the power of React’s useEffect and introducing the AuthInitializer component, we’ve orchestrated a seamless synchronization of data between server and client, achieving the coveted goal of data persistence. This approach elegantly unites server-side rendering (SSR) with client-side interactivity, emblematic of modern web development’s essence.</p><p>Our journey doesn’t end here. To stay updated and continue learning, follow me on Twitter and delve deeper into web development topics on Medium.</p><p>Follow me on Twitter: @ionikdev</p><p>Read more on Medium: <a href="https://medium.com/u/d8d0c736f734">Damilola Esan</a></p><p>Thank you for accompanying me on this voyage to mastering Redux state hydration in Next.js. Together, we’ve overcome challenges to craft remarkable web applications.</p><h3>Relevant References:</h3><ol><li><a href="https://nextjs.org/docs/messages/react-hydration-error#common-causes">Text content does not match server-rendered HTML | Next.js (nextjs.org)</a></li><li><a href="https://react.dev/reference/react-dom/hydrate">hydrate — React</a></li><li><a href="https://nextjs.org/docs/app/building-your-application/caching#3-react-hydration-and-reconciliation-on-the-client">Building Your Application: Caching | Next.js (nextjs.org)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=890d0e0343df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost Your Productivity with Git: Learn Essential Commands for Maximum Efficiency]]></title>
            <link>https://medium.com/@ionikdev/mastering-git-essential-commands-every-programmer-should-know-709abad6f82?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/709abad6f82</guid>
            <category><![CDATA[community]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Fri, 07 Apr 2023 08:56:42 GMT</pubDate>
            <atom:updated>2023-04-07T09:18:20.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GDKtUEUv5iJI77H3" /><figcaption>Photo by <a href="https://unsplash.com/@pankajpatel?utm_source=medium&amp;utm_medium=referral">Pankaj Patel</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a programmer, it is essential to have a good command over Git and version control tools to efficiently manage and track your projects. Although some Git commands are frequently used, there are several other commands that can come in handy while working on projects. This article aims to provide an overview of essential Git commands that every programmer should know to ensure the production of high-quality code, so let’s dive in.</p><ol><li><strong>git config:</strong></li></ol><p>This command sets the configuration values of the project, such as the username, email, file formats, and more.</p><p>Example:</p><pre>git config --global user.name &quot;John Doe&quot;<br>git config --global user.email johndoe@example.com<br></pre><p><strong>2. git init:</strong></p><p>This command is used to initialize a project as a Git repository.</p><p>Example:</p><pre>mkdir my-project<br>cd my-project<br>git init</pre><p>3.<strong> git remote add origin &lt;link-to-github-remote-repo&gt;:</strong></p><p>This command is used to add or connect to a remote repository.</p><p>Example:</p><pre>git remote add origin https://github.com/username/project.git</pre><p>4. <strong>git status:</strong></p><p>This command is used to track the status of files in your local repository, such as whether they are tracked, untracked, or modified.</p><p>Example:</p><pre>git status</pre><p>5.<strong> git clone &lt;link-to-github-remote-repo&gt;:</strong></p><p>This command is used for downloading existing source code from a remote repository, such as GitHub.</p><p>Example:</p><pre>git clone https://github.com/username/project.git</pre><p>6.<strong> git remote :</strong></p><p>This command is used to view connected remote repositories.</p><p>Example:</p><pre>git remote -v</pre><p>7. <strong>git add &lt;file name&gt;</strong></p><p>is a command that adds changes to files to the staging area, so that they can be included in the next commit.</p><pre>git add index.html<br><br>git add index.html style.css page.js<br></pre><p><strong>git add .</strong></p><p>is used to stage all changes in the current directory and its subdirectories for the next commit.</p><pre>git add .</pre><p>8. <strong>git rm -r — cached &lt;fileName&gt;:</strong></p><p>This command is used to remove a file from the remote repository(GitHub) without deleting it in your local repository.</p><p>Example:</p><pre>git rm -r --cached index.html</pre><p>9. <strong>git commit -m &lt; commit message &gt;</strong></p><p>This command is used to commit staged files and provide a commit message for the commit history.</p><pre>git commit -m &quot;Add index.html&quot;</pre><h3>10. <strong>git push -u origin &lt;branch-name&gt;</strong></h3><p>This command is used to push committed files to the remote repository (GitHub) in the specified branch. Use this command for the very first time you push files to the remote repository. It will establish where you are pushing these files to. The next time(s) you push files, you can use <strong>git push</strong></p><pre>git push origin master</pre><p><strong>git push</strong></p><p>This command is used to push committed files to the remote repository. You can only use this command to push files to the remote repository AFTER having pushed files using the previous command.</p><pre>git push</pre><p>11. <strong>git fetch:</strong></p><p>This command is used to fetch the most updated version of your local repository.</p><pre>git fetch</pre><p>12. <strong>git pull</strong></p><p>This command is used to take that information you just fetched and pull it into your local repository. This updates your local repository to the most updated version of your remote repository.</p><pre>git pull</pre><p>13. <strong>git branch</strong></p><p>This command is used to preview the branch you are currently on</p><pre>git branch</pre><p><strong>git branch &lt;branch-name&gt;:</strong></p><p>This command is used to create a branch in your local repository.</p><pre>git branch feature</pre><p><strong>git branch -d &lt;branch-name&gt;:</strong></p><p>This command is used to delete a branch in your local repository.</p><pre>git branch -d feature</pre><p>14. <strong>git checkout — track/&lt;branch name&gt;:</strong></p><p>This command is used to switch to a branch that was created in the remote repository for the first time.</p><pre>git checkout --track origin/feature</pre><p><strong>git checkout &lt;branch name&gt;:</strong></p><p>This command is used to switch to a branch you have already visited before.</p><pre>git checkout feature</pre><p><strong>15. git merge &lt;branch name&gt;:</strong></p><p>This command is used to merge two branches together. To do this, enter the branch that you want to inherit the changes. And the branch name you would use along with this command is the branch that will provide the changes.</p><pre>git merge container</pre><p>16.<strong> git merge — abort:</strong></p><p>This command is used to abort a merge if there are conflicts.</p><pre>git merge --abort</pre><p>17. <strong>git merge -X theirs &lt;branch name&gt;:</strong></p><p>This command is used to merge two branches together. And if there are merging conflicts, this command will just assume that you’d prefer the changes made in the mentioned branch (rather than the current one).</p><pre>git merge -X theirs feature</pre><p>18. <strong>git reset — hard HEAD</strong></p><p>This command will erase all the changes you’ve made in your local repository and update it to the latest version that was committed to GitHub.</p><pre>git reset --hard HEAD</pre><p>19.<strong> git clean -f</strong></p><p>This command is used to delete untracked files in your local repository.</p><pre>git clean -f</pre><p>20.<strong> git clean -d</strong></p><p>This command is used to delete untracked directories in your local repository. You can also combine it into <strong>git clean -fd </strong>to do both.</p><pre>git clean -d</pre><p>21. <strong>git log</strong></p><p>The git log command is used to view the commit history of a git repository, showing the latest commit first. You can use various options with git log to display different aspects of the commit history, such as author, date, commit message, and more.</p><pre>git log</pre><p>In conclusion, Git is a powerful tool for version control and is a must-have for any programmer. By mastering these 21 essential Git commands, you can streamline your workflow, collaborate effectively, and produce high-quality code. Don’t be afraid to experiment and learn more about Git, as there are many other commands and features that can take your development skills to the next level. Follow me on Medium and Twitter <a href="https://medium.com/u/d8d0c736f734">Damilola Esan</a> for more articles like this, and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=709abad6f82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Programming Terminology: Clearing the Hurdles to Effective Learning]]></title>
            <link>https://medium.com/@ionikdev/understanding-programming-terminology-clearing-the-hurdles-to-effective-learning-b7640dc69a8a?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7640dc69a8a</guid>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 09:53:55 GMT</pubDate>
            <atom:updated>2023-03-13T10:18:54.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqC6jwSi9obdEprd5d7TEg.png" /><figcaption>Photo by Christina @ wocintechchat.com on Unsplash</figcaption></figure><h3>Introduction</h3><p>Starting a career in web development can be an exciting and daunting prospect. The technology industry is filled with complex terminology that can leave newcomers feeling confused and unsure of where to start. However, the fundamental concepts behind these terms are often straightforward and accessible to everyone. In this article, we will outline the key considerations you need to keep in mind as you embark on your journey to becoming a web developer. From understanding the basics of the internet to mastering different string cases and more, this article will help you start your web development journey on the right foot. So, let’s dive in!</p><h3><strong>1. Internet</strong></h3><p>• <strong>URL</strong>: A Uniform Resource Locator is a specific address used to locate a webpage or file on the internet, such as &quot;https://www.example.com&quot;.</p><p>• <strong>HTTP</strong>: Hypertext Transfer Protocol is the foundation of the World Wide Web and is used for transferring data over the internet.</p><p>• <strong>HTTPS</strong>: Hypertext Transfer Protocol Secure is an extension of HTTP that adds an extra layer of security by encrypting data transferred between a website and a user&#39;s browser.</p><p>• <strong>Web browser</strong>: A software application that enables users to access and navigate the World Wide Web, including popular options like Chrome, Firefox, Safari, and Edge.</p><p>• <strong>Web server</strong>: A software that receives and handles client requests and sends back responses, such as HTML pages, files, or data. Examples of web servers include Apache and Nginx.</p><p>•<strong> IP address</strong>: Each device connected to a computer network using the Internet Protocol for communication is assigned a unique numerical label known as an IP address.</p><p>• <strong>DNS</strong>: The Domain Name System is a system that translates domain names like &quot;www.example.com&quot; into IP addresses, making it easier for users to access websites using human-readable names instead of IP addresses.</p><p>• <strong>Cookies</strong>: Small text files that are stored on a user&#39;s computer by a web server and contain information such as login status or preferences, which can be accessed by the server on subsequent visits to the same website.</p><p>• <strong>Cache</strong>: A temporary storage area that holds frequently accessed data, such as images or videos, to improve the performance and responsiveness of a website. This storage area can be located on either a user&#39;s computer or on a server.</p><p>• <strong>Search Engine</strong>: Software that searches and indexes the internet and returns the results of the search query to the users. Popular search engines include Google, Bing, Yahoo, and DuckDuckGo.</p><h3>2. Web Development</h3><p>When it comes to web development, there are a variety of concepts and technologies to familiarize yourself with. Some key areas to explore include:</p><p>• <strong>Front-end</strong>: This aspect of web development focuses on the user interface and user experience, encompassing the layout, design, and interactivity of a website or web application. Front-end developers often work with technologies such as HTML, CSS, and JavaScript to create responsive and engaging experiences for users.</p><p>• <strong>Back-end</strong>: The back-end of a website or web application encompasses the server-side logic and database management necessary to handle user requests and store data. Back-end developers may work with languages like PHP, Ruby, Python, or Java, as well as frameworks like Node.js or Django.</p><p>• <strong>Full-stack</strong>: Developers who are proficient in both front-end and back-end development are often referred to as &quot;full-stack&quot; developers, able to build and maintain all aspects of a web project.</p><p>• <strong>Responsive design</strong>: With the proliferation of mobile devices and varying screen sizes, responsive design has become an essential aspect of web development. This involves designing and developing websites that can adapt to different devices&#39; screen sizes and resolutions, providing a consistent and user-friendly experience.</p><p>• <strong>CMS</strong>: A Content Management System is a software application that allows users to create, manage, and publish digital content, such as text, images, and videos, without needing technical expertise. Common CMS platforms include WordPress, Drupal, and Joomla.</p><p>• <strong>SEO</strong>: Search Engine Optimization involves optimizing a website to improve its visibility and ranking in search engine results pages. This includes factors like site structure, keyword research, and content creation.</p><p>•<strong> Framework/libraries</strong>: Frameworks and libraries are pre-written code collections that offer a foundation for building web applications and streamline repetitive tasks such as user input handling and server requests. Popular frameworks and libraries include React, Angular, and Vue.js. By using these tools, web developers can save time and improve the overall quality of their code.</p><p>• <strong>API endpoint:</strong> An API endpoint is the location of a web service or server that can be accessed by a client to retrieve or update data. This is often accomplished using HTTP requests and response formats like JSON.</p><p>• <strong>CDN</strong>: Content Delivery Networks are networks of servers distributed worldwide that cache and serve content, such as images, videos, and scripts, to users based on their location. This can improve website performance and reduce server load.</p><p>• <strong>DOM</strong>: The Document Object Model is a tree-like representation of an HTML or XML document, which can be manipulated using JavaScript to change a website’s layout, content, and style.</p><p>• <strong>AJAX</strong>: Asynchronous JavaScript and XML is a technique for making asynchronous HTTP requests and updating parts of a webpage without reloading the whole page. This can provide a more seamless and responsive user experience.</p><p>• <strong>ES6</strong>: ECMAScript 6 is the sixth version of the ECMAScript standard for JavaScript, which introduced new features such as arrow functions, template literals, and destructuring assignments. These can help make JavaScript code more concise and expressive.</p><p>• <strong>Transpiling</strong>: Transpiling is the process of converting code written in one programming language, such as ES6, into another language that is more widely supported, such as ES5. This can help ensure code compatibility across different environments and browsers.</p><p>• <strong>Linting</strong>: Linting refers to the automatic checking of code for potential errors or style issues, providing suggestions to fix them. This can help improve code quality and maintainability. Popular linters for JavaScript include ESLint and JSLint.</p><h3><strong>3. Software Programming</strong></h3><p>• <strong>Bug</strong>: An error or defect in a program that causes it to produce unexpected or incorrect results.</p><p>• <strong>Code refactoring</strong>: The process of restructuring existing computer code without changing its external behavior.</p><p>• <strong>Debugging</strong>: The process of identifying and fixing errors in a program.</p><p>• <strong>Object-Oriented Programming</strong> (OOP): A programming paradigm based on the concept of &quot;objects,&quot; which can contain data and code that manipulates that data.</p><p>• <strong>Function</strong>: A block of code that can be called by other parts of a program to perform a specific task.</p><p>• <strong>Variable</strong>: A named location in a computer&#39;s memory that stores a value that can be changed during the execution of a program.</p><p>• <strong>Algorithm</strong>: A set of instructions or steps to solve a problem or accomplish a task.</p><p>• <strong>API</strong>: An application programming interface that provides a set of rules and protocols for building and interacting with software applications.</p><p>• <strong>Compiler</strong>: A program that converts code written in a high-level programming language into machine code that a computer can execute.</p><p>• <strong>Syntax</strong>: The set of rules that govern the structure of a programming language.</p><p>• <strong>Library</strong>: A collection of pre-written code that can be used to perform common tasks, such as input/output, graphics, and data manipulation, in a program.</p><h3><strong>4. String Cases</strong></h3><p>• <strong>Upper case:</strong> When all letters in a string are capitalized.</p><p>• <strong>Lower case</strong>: When all letters in a string are in small letters.</p><p>• <strong>Title case</strong>: When the first letter of each word in a string is capitalized while the rest are lowercase.</p><p>• <strong>Camel case</strong>: When the first word in a string is in lowercase, and subsequent words are capitalized, with no spaces or punctuation between them.</p><p>• <strong>Snake case</strong>: When underscores separate words in a string, and all the letters are in lowercase.</p><p>• <strong>Pascal case</strong>: Similar to camel case, but the first letter of the first word is also uppercase.</p><p>• <strong>Kebab-case</strong>: When hyphens separate words in a string, and all letters are in lowercase.</p><p>• <strong>Constant case:</strong> When all letters in a string are in uppercase and separated by an underscore.</p><p>• <strong>Train-case</strong>: Similar to kebab-case, but the first letter of each word is capitalized. For example, the string &quot;Hello-World&quot; is in Train-case.</p><h3><strong>Conclusion</strong></h3><p>Web development can seem overwhelming at first, but by familiarizing yourself with the fundamental concepts, you can start your journey with confidence. Understanding the basics of the internet, the front-end and back-end of web development, responsive design, and different technologies like JavaScript frameworks, APIs, and CDNs is essential to creating successful websites and web applications. Additionally, being familiar with string cases, linting, and transpiling can help you write clean, concise, and maintainable code. Keep these concepts in mind as you learn and practice web development, and don’t forget to stay up-to-date with the latest trends and technologies. Following me here on Medium and on Twitter : <a href="https://medium.com/u/d8d0c736f734">Damilola Esan</a> for more article about web development and Technologies in general. Thank you for reading and Good luck on your journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7640dc69a8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Gratitude: Why Appreciating Our Supporters Matters for Personal and Professional…]]></title>
            <link>https://medium.com/@ionikdev/the-power-of-gratitude-why-appreciating-our-supporters-matters-for-personal-and-professional-2d8d9780210?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d8d9780210</guid>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 07:54:43 GMT</pubDate>
            <atom:updated>2023-03-02T07:54:43.902Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Power of Gratitude: Why Appreciating Our Supporters Matters for Personal and Professional Growth</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*gAVYjR5uOAVq6f6uL-SGpQ.jpeg" /><figcaption>Image by Buddha Doodles on Pinterest</figcaption></figure><h3>Introduction:</h3><p>As we navigate through life, we encounter people who significantly contribute to our personal and professional development. They challenge us to step outside our comfort zones, inspire us to take on new challenges, and offer invaluable guidance. In this article, we will discuss the significance of acknowledging and valuing those who have aided us in becoming the best possible versions of ourselves.</p><h3><strong>● The Impact of Mentors on Personal and Professional Growth</strong></h3><p>Reflecting on my personal and professional growth journeys, I’ve come to realize the importance of recognizing and appreciating the people who have had a significant impact on my life. One such individual is my friend and mentor, <a href="https://medium.com/u/5751684b99da">Justice Ekemezie</a> , whose guidance and support have been invaluable. <a href="https://medium.com/u/5751684b99da">Justice Ekemezie</a> encouraged me to step out of my comfort zone and learn new skills, such as React, and provided technical support and career advice that helped me develop both technical and interpersonal skills. His positive attitude and willingness to help others inspired me to pay it forward and support others in their growth journeys.</p><p>It’s easy to underestimate the impact that certain people have on our lives, whether they are our college professors, mentors, friends, or anyone else. But by taking a moment to reflect and show gratitude for those who have helped us become the best version of ourselves, we can better appreciation what they have done for us. <a href="https://medium.com/u/5751684b99da">Justice Ekemezie</a> has made a significant impact on my life, and I’m grateful for his guidance and support along the way.</p><h3>● Embracing New Opportunities for Personal and Professional Growth</h3><p>When a friend suggested I learn a new skill to advance my career, I initially dismissed it. But I soon realized that learning new skills was crucial to remain relevant in my field. Despite facing challenges like distractions at home and unreliable electricity, I took a risk and moved to a new environment to learn and grow. Surrounding myself with others who were coding every day provided a supportive and inspiring atmosphere that motivated me to push myself harder.</p><p>This experience taught me the importance of being open to new opportunities and taking risks. Sometimes it takes stepping outside of our comfort zones to achieve personal and professional growth.</p><h3>● Embrace Feedback for Continuous Improvement</h3><p>Receiving feedback, whether positive or negative, is crucial for personal and professional growth. It can be difficult to accept criticism, but it’s an essential step in developing our skills and improving our work. During my journey of learning and growth, I learned the importance of being open to feedback from various sources, including mentors, colleagues, peers, and clients. Taking <a href="https://medium.com/u/5751684b99da">Justice Ekemezie</a> feedback into account and making necessary improvements helped me progress and become better at what I do. Incorporating feedback into our work can be a continuous process, and we should strive to seek it out regularly to help us continuously improve.</p><h3>● Document Your Progress to Stay Accountable</h3><p>Keeping track of your progress is essential for learning and growth. By documenting your progress, you can celebrate your successes, learn from your failures, and keep track of your growth over time. It’s important to hold yourself accountable for your progress and use it as motivation to keep moving forward. There are various ways to document your progress, such as keeping a journal, a to-do list, or a project management tool. You can also share your progress with a mentor, teacher, or colleague to receive feedback and guidance, which can further enhance your growth and development. So, make sure to document your progress and use it as a valuable tool for personal and professional development.</p><h3>● Paying It Forward: Fostering a Culture of Learning and Growth</h3><p>One of the most important lessons I learned during my journey of learning and growth was the value of paying it forward. After receiving support and guidance from <a href="https://medium.com/u/5751684b99da">Justice Ekemezie</a> , I realized the importance of helping others who are also on their own journey. By sharing my experiences, offering advice, and mentoring others, I can contribute to their growth and development.</p><p>Paying it forward not only benefits others but also reinforces my own learning. When I share my knowledge with others, I am forced to think more deeply about what I have learned and how I can apply it to help someone else. Additionally, it helps to create a culture of learning and growth, where everyone is encouraged to share their knowledge and support each other.</p><p>By paying it forward, we can create a ripple effect of growth and development that can benefit not only individuals but also entire organizations and communities.</p><p><strong>In conclusion</strong>, I want to express my sincere gratitude to everyone who has contributed to my personal and professional growth journey. Without their help, I would not be where I am today. They pushed me out of my comfort zone and encouraged me to learn new skills, provided technical support and career advice, and inspired me to pay it forward and help others in their growth journeys.</p><p>But don’t stop there! Take action and reach out to those who have supported you. Thank them for their help and let them know how much it has meant to you. And just as importantly, be the one to support others in their growth journeys. Whether it’s through mentorship, providing technical support, or simply offering a listening ear, your actions can make a big difference.</p><p>Embracing new opportunities for learning and growth, being open to feedback, documenting your progress, and paying it forward can help you and others achieve your goals and contribute to a culture of learning and growth. Let’s continue to support each other and strive for continuous improvement and development. Together, we can create a world where everyone has the opportunity to reach their full potential.</p><p>I hope this article has inspired you to reflect on your own journey and appreciate the people who have helped you become the best version of yourself. If you found this article helpful, I invite you to follow me on Medium and Twitter: <a href="https://medium.com/u/d8d0c736f734">Damilola Esan</a> to receive more tips and insights on personal and professional growth and Tech in general. Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d8d9780210" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Launching a Career in Tech: My Journey]]></title>
            <link>https://medium.com/@ionikdev/a-beginners-guide-to-launching-a-career-in-tech-my-journey-76296464dfc6?source=rss-d8d0c736f734------2</link>
            <guid isPermaLink="false">https://medium.com/p/76296464dfc6</guid>
            <dc:creator><![CDATA[Damilola Esan]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 09:15:29 GMT</pubDate>
            <atom:updated>2023-02-17T09:15:29.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8n1z70Xv5m9VRP64Yzsgdg.jpeg" /><figcaption>Photo by jcomp on Freepik</figcaption></figure><h3>Introduction:</h3><p>In this article, I want to share my story, with all the highs and lows, and offer some tips on things to consider doing and things to avoid as you break into the tech world. I hope my experience can inspire and guide you on your own journey to success.</p><p>Breaking into the tech industry can be a wild ride, and for me, it all started with a push from my vice principal in secondary school. She challenged me to build a website for the school. I had no experience in coding and felt intimidated and pressured. But I took on the challenge and formed a team with my friends. We were all beginners, fueled by the desire to impress our vice principal and the promise of 30,000 naira (which was a lot of money in my teenage years!).</p><p>Our journey was filled with challenges, frustration, and a lot of head-scratching moments. I remember when my image wouldn&#39;t display on the website for a whole week, and I was ready to give up. But we persevered and ultimately succeeded in building a website for the school. When we got paid for our hard work, it was a proud moment for us all.</p><h3>• Map Your Journey in Tech</h3><p>Becoming a tech professional can be a journey that starts from unexpected places. For some, it&#39;s a lifelong passion, while for others, it&#39;s a matter of circumstance. In my case, it was the latter.</p><p>When I started, I had no real interest in coding. I only did it for the challenge and the money. After completing the website for the school, people started calling me a programmer, and I enjoyed the attention. But deep down, I knew I was lying to myself and others about my skills.</p><p>It took me three years to realize that honesty and self-awareness are essential traits in any profession. It&#39;s better to be honest with yourself and others about your skills and knowledge, rather than pretending to be something you&#39;re not. By acknowledging my weaknesses, I was able to take the necessary steps to improve my skills and achieve my goals.</p><h3>• Learn From Your Mistakes</h3><p>Making mistakes is part of the journey, especially in the tech industry. I made the mistake of lying about my skills, and it cost me time and opportunities. But I learned from that mistake and made a commitment to learn and improve my skills.</p><p>When you make a mistake, don&#39;t beat yourself up about it. Instead, take the opportunity to learn from it and do better next time. Use the experience to grow and improve yourself, both personally and professionally.</p><h3>• Build Your Network</h3><p>Building a network is essential in any industry, and the tech industry is no different. Attend networking events, join online communities, and connect with people who share your interests and passions. You never know who you might meet, and how they might help you in your career.</p><h3>• Gain experience:</h3><p>Experience is crucial in the tech industry, and there are many ways to gain it. Consider internships, apprenticeships, freelancing, or volunteering in tech-related projects. Building a portfolio of work can also be helpful in showcasing your skills and experience to potential employers.</p><h3>• Develop a strong skillset</h3><p>In addition to technical skills, soft skills such as communication, problem-solving, and teamwork are also important in the tech industry. Continuously work on improving your skills and seek out opportunities to learn new technologies and tools.</p><h3>• Be adaptable</h3><p>The tech industry is constantly evolving, and it&#39;s important to be adaptable and open to change. Be willing to learn new technologies and adapt to new roles or responsibilities as needed.</p><h3>Conclusion:</h3><p>Breaking into the tech industry can be an exciting and challenging journey. My own journey began with a push from my vice principal to build a website for my school, and it ultimately led me to discover my passion for coding. As you embark on your own journey, remember to stay curious, persistent, and open to new opportunities.</p><p>Honesty and self-awareness are also crucial traits to cultivate as you pursue a career in tech. Be honest with yourself and others about your skills and knowledge, and don&#39;t be afraid to seek out help and guidance from mentors, colleagues, and online resources. And, as you gain more experience and skills, be sure to pay it forward by helping others in the industry.</p><p>Finally, remember that employers value employees who are not only skilled but also willing to learn and grow. Demonstrate your willingness to learn and your commitment to personal and professional growth, and you’ll be well on your way to achieving success in the tech industry. With hard work, determination, and a commitment to lifelong learning, anything is possible.</p><p>Thank you for reading my article on breaking into the tech industry. I hope you found it helpful and inspiring. If you’d like to stay up-to-date on my future articles, tutorials, and professional experiences, I invite you to follow me here on Medium and Twitter: <a href="https://twitter.com/adekunle876?t=uwnEStd6RFR0Fne3psdkXQ&amp;s=09">https://twitter.com/adekunle876?t=uwnEStd6RFR0Fne3psdkXQ&amp;s=09</a>. I’m committed to giving back to the community that has helped me grow as a developer and sharing my journey with others. Thank you again for your support and I look forward to connecting with you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76296464dfc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>