<?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 Victoria Oluwaferanmi on Medium]]></title>
        <description><![CDATA[Stories by Victoria Oluwaferanmi on Medium]]></description>
        <link>https://medium.com/@victoriaoluwaferanmi?source=rss-da1bf9d78cf7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n-4JL-O_l8mx2_ixHeETHA.jpeg</url>
            <title>Stories by Victoria Oluwaferanmi on Medium</title>
            <link>https://medium.com/@victoriaoluwaferanmi?source=rss-da1bf9d78cf7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:56:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@victoriaoluwaferanmi/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[How to Set Up an AWS Application Load Balancer with Two EC2 Instances.]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/how-to-set-up-an-aws-application-load-balancer-with-two-ec2-instances-d72acec45c0a?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d72acec45c0a</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 22:09:13 GMT</pubDate>
            <atom:updated>2026-10-20T22:09:13.608Z</atom:updated>
            <content:encoded><![CDATA[<p>A web application running on a single server can become a bottleneck as traffic increases. If that server becomes unavailable, users may also lose access to the application.</p><p>One way to address these challenges is to distribute incoming requests across multiple backend servers using a load balancer.</p><p>Amazon Web Services (AWS) provides the <strong>Application Load Balancer (ALB)</strong>, which distributes application traffic across registered targets, such as Amazon EC2 instances.</p><p>In this guide, we will explore how to deploy two Apache web servers on EC2 and configure an Application Load Balancer to route incoming HTTP requests between them.</p><h3>1. Understanding the Architecture</h3><ul><li><strong>Amazon EC2:</strong> Virtual servers that host the web application.</li><li><strong>Apache HTTP Server:</strong> Software that serves web content from each EC2 instance.</li><li><strong>Application Load Balancer:</strong> The entry point for incoming application traffic.</li><li><strong>Target Group:</strong> A collection of registered backend targets that receive forwarded requests.</li><li><strong>Security Groups:</strong> Virtual firewalls that control network traffic to the load balancer and EC2 instances.</li></ul><h3>How the components communicate</h3><p>The request follows this path:</p><p><strong>User’s Browser &gt;&gt;Application Load Balancer &gt;&gt;Target Group &gt;&gt;EC2 Web Server 1 and EC2 Web Server 2</strong></p><p>When a user accesses the load balancer’s DNS name, the ALB receives the request through its listener. The listener forwards the request to the configured target group, which contains the backend web servers.</p><p>The load balancer then selects an eligible target to handle the request.</p><p>This design provides a single entry point for users while allowing the application to run across multiple servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*ZegFvZ-1TFttJEuFgi35cw.png" /><figcaption>Architecture Diagram</figcaption></figure><h3>2. Launching the EC2 Instances</h3><p>The first step is to create two EC2 instances that will act as backend web servers.</p><p>For this example, both instances run Ubuntu Linux.</p><p>Each instance requires:</p><ul><li>An appropriate EC2 instance type.</li><li>A configured VPC and subnet.</li><li>A security group allowing the required traffic i.e HTTP (80) and SSH (22) .</li></ul><p>The instances should be placed in suitable Availability Zones for the intended architecture. You will use subnets in at least two Availability Zones for the load balancer.</p><h3>3. Installing Apache on Both Servers</h3><p>Apache is the web server responsible for serving HTTP content from each EC2 instance.</p><p>Connect to each Ubuntu instance and install Apache:</p><pre>sudo apt update<br>sudo apt install apache2 -y<br>sudo systemctl enable --now apache2</pre><p>Verify that Apache is running:</p><pre>sudo systemctl status apache2</pre><p>You can also test the web server locally:</p><pre>curl http://localhost</pre><p>A successful response confirms that Apache is responding locally on the instance. You can also verify on your browser by copying the public address of each of the instances on the browser. A successful response will show the Apache default page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w3A7d6yr12XGde7LPYen1g.png" /><figcaption>Server Web page</figcaption></figure><h3>Creating identifiable web pages</h3><p>To identify which server responds to a request, configure a different page on each instance.</p><p>On Web Server 1:</p><pre>nano /var/www/html/index.html<br>//add the content you want to see on your server1</pre><p>On Web Server 2:</p><pre>nano /var/www/html/index.html<br>//add the content you want to see on your server2</pre><p>When the two pages are accessible through the load balancer, their different messages help demonstrate which backend server handled a request.</p><h3>4. Creating the Target Group</h3><p>A target group defines the backend resources to which the load balancer forwards requests.</p><p>Create a target group with the following configuration:</p><p>Target type — Instances</p><p>Protocol — HTTP</p><p>Port — 80</p><p>Health check path — /</p><p>Registered targets — Both EC2 instances</p><p>Register both web servers as targets.</p><h3>What are health checks?</h3><p>Health checks allow the load balancer to determine whether registered targets are able to receive traffic.</p><p>For example, an HTTP health check on / sends a request to the configured path and evaluates the response against the health-check settings.</p><p>A target that fails health checks may be excluded from normal routing until it becomes healthy again.</p><p>This is why verifying target health is an important step before testing the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yyMSuK79D3iqAA5peGAk0Q.png" /><figcaption>Target ‘Group</figcaption></figure><h3>5. Creating the Application Load Balancer</h3><p>The Application Load Balancer acts as the public entry point to the application.</p><p>Create an ALB with these settings:</p><ul><li><strong>Scheme:</strong> Internet-facing.</li><li><strong>IP address type:</strong> IPv4, for this example.</li><li><strong>Listeners:</strong> HTTP on port 80.</li><li><strong>Availability Zones:</strong> Select suitable public subnets in at least two Availability Zones.</li><li><strong>Default action:</strong> Forward requests to the configured target group.</li><li><strong>Target Group:</strong> The target group(of the two instances)created must be selected</li></ul><p>After the ALB is created, AWS provides a DNS name that can be used to access it.</p><p>When a browser sends a request to this DNS name, the ALB receives the request and forwards it to an eligible target in the target group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaVfpFNHYN56YHY_XIC1xA.png" /><figcaption>Creating Load Balancer</figcaption></figure><h3>6. Configuring Security Groups</h3><p>Correct security group rules are essential for communication between the components.</p><h3>Load balancer security group</h3><p>Allow inbound HTTP traffic on port 80 from the intended clients. For a public demonstration, this may be 0.0.0.0/0, meaning any IPv4 address can attempt to connect.</p><h3>EC2 web server security group</h3><p>Allow inbound HTTP traffic on port 80 <strong>from the load balancer’s security group</strong>, rather than opening the web servers’ HTTP ports to the entire internet.</p><p>Restrict SSH access to a trusted administrative IP address or use a managed access method such as AWS Systems Manager where appropriately configured.</p><p>For a more secure architecture, place the web servers in private subnets and allow public access only through the load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwu8iflH917i7NPF9gIAyg.png" /><figcaption>Load Balancer Security Group</figcaption></figure><h3>7. Testing the Deployment</h3><p>After configuring the infrastructure, validate each component.</p><h3>Test your servers in browser</h3><pre>http://YOUR-SERVER1-PUBLIC-ADDRESS<br>http://YOUR-SERVER2-PUBLIC-ADDRESS</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4AUYDMAWmjSh0rqwgXB9A.png" /><figcaption>SERVER 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sL9GvDyb4hcAEGe4jYfcEg.png" /><figcaption>SERVER 2</figcaption></figure><h3>Test through the load balancer</h3><p>Open the ALB DNS name in a browser:</p><pre>http://YOUR-LOAD-BALANCER-DNS-NAME</pre><p>Replace the placeholder with the actual DNS name assigned to your load balancer.</p><p>The request should reach the application through the ALB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khcY6gcmIvpUQo6TtRg41Q.png" /></figure><h3>8. Common Problems and Troubleshooting</h3><h3>HTTP requests time out</h3><p>Check that the ALB security group permits inbound HTTP traffic and that the backend security group permits HTTP traffic from the ALB security group.</p><p>Also verify the subnet routing and network access configuration.</p><h3>The load balancer returns a 503 error</h3><p>A 503 response can indicate that the load balancer has no usable registered targets. Check whether the target group contains registered instances and whether any are healthy.</p><h3>A target is unhealthy</h3><p>Confirm that Apache is running, the configured health-check path returns an acceptable response, and the target group uses the correct protocol and port.</p><h3>The load balancer works, but direct EC2 access does not</h3><p>This can be intentional. If the EC2 security group allows HTTP only from the ALB security group, direct browser requests to an instance’s public IP will not be allowed by that rule.</p><p>Direct public access to backend servers is not necessary for testing an architecture designed to receive application traffic through the load balancer.</p><h3>Conclusion</h3><p>An AWS Application Load Balancer provides a managed way to distribute incoming HTTP requests across multiple servers.</p><p>By combining EC2, Apache, target groups, health checks, and security groups, we built a web application architecture with a central entry point and multiple targets.</p><p>Understanding how these components interact is essential when deploying, securing, and troubleshooting applications in the cloud.</p><p><strong>Project implementation:</strong> <a href="https://github.com/VictoriaOluwaferanmi/aws-application-load-balancer">https://github.com/VictoriaOluwaferanmi/aws-application-load-balancer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d72acec45c0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Deploying a LAMP Web Application on AWS EC2: From Browser Request to Database]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/building-and-deploying-a-lamp-web-application-on-aws-ec2-from-browser-request-to-database-d665b271ab4e?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d665b271ab4e</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[load-balancing]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 22:54:08 GMT</pubDate>
            <atom:updated>2026-09-21T11:29:12.661Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will be explaining what happens behind the scenes when you enter my web server’s IP address into a browser.</p><p>I built a simple web application on <strong>AWS EC2</strong> using the LAMP stack:</p><ul><li><strong>Linux</strong> — the operating system</li><li><strong>Apache</strong> — the web server</li><li><strong>MySQL</strong> — the database</li><li><strong>PHP</strong> — the application</li></ul><p>I used two EC2 servers: one for the web application and another for the database.</p><h3>The Architecture</h3><p>The basic setup looks like this:</p><p><strong>User → Internet → Web Server → Database Server</strong></p><p>The <strong>Web Server</strong> runs Apache, PHP, and my application.</p><p>The <strong>Database Server</strong> runs MySQL and stores the student information.</p><p>I kept the database separate from the web server so that users don’t connect directly to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jS8DUuNVF3nagUaJKLmvtg.png" /><figcaption>Architecture Diagram</figcaption></figure><h3>What Happens When you Enter the IP?</h3><p>Let’s say you enter:</p><p>http://&lt;WEB_SERVER_IP&gt;</p><p>in your browser.</p><h3>1. The browser identifies the server</h3><p>When you enter the server’s <strong>IP address</strong> in your browser, the browser knows the destination it needs to connect to.</p><p>It uses that IP address to locate and establish a connection with the <strong>web server</strong>.</p><h3>2. TCP connection</h3><p>Before sending the actual web request, the browser establishes a <strong>TCP connection</strong> with the server.</p><p>This happens through the TCP three-way handshake:</p><p><strong>SYN → SYN-ACK → ACK</strong></p><ul><li><strong>SYN </strong>(Synchronize) : The browser starts the connection.</li><li><strong>SYN-ACK </strong>(Synchronize-Acknowledgment) <strong>: </strong>The server acknowledges the request and says it’s ready.</li><li><strong>ACK </strong>(Acknowledgment) : The browser acknowledges the server’s response.</li></ul><p>After this, the TCP connection is established and the browser can send the <strong>HTTP request</strong>.</p><p>Once the connection is established, communication can begin.</p><h3>3. The browser sends an HTTP request</h3><p>The browser sends an HTTP request to the Web Server.</p><p>Apache receives this request on port 80.</p><h3>4. Apache and PHP do their job</h3><p>Apache handles the request and runs my PHP application.</p><p>My PHP code then connects to the MySQL database and asks for student information.</p><p>The connection looks like:</p><p><strong>Browser → Apache → PHP → MySQL</strong></p><p>MySQL sends the data back to PHP, and PHP generates the page that Apache sends back to my browser.</p><p>So the complete journey is:</p><p><strong>Browser → Web Server → PHP → Database → PHP → Browser</strong></p><h3>What About Security?</h3><p>I used AWS Security Groups to control access to the servers.</p><p>The Web Server allows:</p><ul><li><strong>Port 22</strong> — SSH</li><li><strong>Port 80</strong> — HTTP</li></ul><p>The Database Server allows:</p><ul><li><strong>Port 22</strong> — SSH</li><li><strong>Port 3306</strong> — MySQL source(Web Server’s security group)</li></ul><p>Importantly, MySQL port 3306 is only accessible from the Web Server</p><p>This means only an EC2 instance belonging to the Web Server security group can connect to MySQL i.e not publicly accessible.</p><p>Note:<br>The PHP application connects to the database using the <strong>Database Server’s private IP address</strong>.</p><h3>Using Bash to Automate Setup</h3><p>Instead of manually installing everything on the Web Server, I created a Bash script called:</p><p>setup-web.sh</p><p>The script:</p><ul><li>Updates the packages</li><li>Installs Apache and PHP</li><li>Starts Apache</li><li>Makes Apache start automatically when the server boots</li><li>Writes a success message to /var/log/setup.log</li></ul><p>Instead of typing the same commands every time I create a server, I can use a script to automate the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-wd-O0ohc_VWAYGXXo9paw.png" /></figure><h3>My Cron Job</h3><p>I also created a cron job that runs <strong>every minute</strong>.</p><p>It records the current date, time, and server uptime in:</p><p>/var/log/uptime.log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKUU3lwc5Ui0n0RHKz-L9g.png" /><figcaption>crontab-l</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuLZtchKcJEnRlVIBiQK1A.png" /><figcaption>uptime log</figcaption></figure><p>In a real production environment, scheduled jobs can be used for things like backups, cleanup tasks, monitoring, and maintenance.</p><h3>What If More Users Start Using the Application?</h3><p>Right now, I only have one Web Server.</p><p>If traffic increases, that single server could become a bottleneck.</p><p>A future version could look like:</p><p><strong>User → Load Balancer → Web Server 1</strong></p><p>** ↘ <strong>Web Server 2</strong></p><p>The Load Balancer would distribute incoming requests between the servers.</p><p>I didn’t deploy these components for this project, but they would be the next step toward making the application more scalable and available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtZTAyfhZY2vxzIcdhv2PA.png" /><figcaption><em>Architecture diagram showing the future deployment</em></figcaption></figure><h3>What I Learned</h3><p>This project helped me understand that a website is more than just the code we see in the browser.</p><p>A simple request can involve:</p><p><strong>Browser → Internet → Web Server → PHP → Database → Web Server → Browser</strong></p><p>I also got hands-on experience with:</p><ul><li>Linux server administration</li><li>AWS EC2</li><li>Networking and ports</li><li>Apache and PHP</li><li>MySQL</li><li>Bash scripting</li><li>Cron jobs</li><li>Security Groups</li><li>Basic cloud architecture</li></ul><p>The biggest takeaway for me was seeing how all these pieces connect to create a working web application.</p><h3>Final Thoughts</h3><p>This was a simple application, but it gave me a much better understanding of what happens behind the scenes when we visit a website.</p><p>There’s still a lot more to explore, especially around load balancing, scaling, monitoring, and security.</p><p>But this was a good starting point for understanding how applications actually get from <strong>code on a server to a page in a browser</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d665b271ab4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From a Simple Bucket to AWS S3: My First Cloud Storage Setup]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/from-a-simple-bucket-to-aws-s3-my-first-cloud-storage-setup-e6bcd376d0e3?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6bcd376d0e3</guid>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 22:17:16 GMT</pubDate>
            <atom:updated>2026-09-10T01:22:10.330Z</atom:updated>
            <content:encoded><![CDATA[<p>When you think about storing your essentials, you have many options.</p><p>You could use a drawer, a trolley, or a cabinet to keep your things. They can help you organize your belongings, but sometimes, you don’t need all that complexity.</p><p>Sometimes, <strong>a simple bucket is enough.</strong></p><p>A bucket gives you a place to keep your things. It is simple, convenient, and easy to use.</p><p>Now, take that idea into the cloud.</p><p>Instead of storing clothes, toys, or household items, what if you wanted to store <strong>images, HTML files, videos, backups, or other digital files?</strong></p><p>That’s where <strong>Amazon S3</strong> comes in.</p><h3>What is Amazon S3?</h3><p><strong>Amazon S3 stands for Simple Storage Service.</strong> It is an AWS service used to store and retrieve data in the cloud.</p><p>The easiest way I understand it is: <strong><em>An S3 bucket is like a bucket for your digital files(images, documents, backups, etc)</em></strong></p><p>The files stored inside an S3 bucket are called <strong>objects</strong>.</p><p>In this article we would be creating an S3 bucket, upload an image as file, configured access to it, and open the image directly in my browser.</p><h3>Step 1: Sign in or Sign up into AWS</h3><p>I started by logging into the AWS Management Console and navigating to <strong>Amazon S3</strong>.</p><p>In the search bar, search for S3 under services, proceed by clicking on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtLuDVU2U1MISJIEB82--Q.png" /></figure><h3>Step 2: Creating an S3 Bucket</h3><p><strong>Create bucket</strong> and provided a unique bucket name.</p><p>Important things to note is that <strong>S3 bucket names must be globally unique</strong>. This means the name chosen should not already be in use by another AWS account. Also, bucket names must follow the naming rules provided by AWS. To explore this rules check this <a href="http://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html?icmpid=docs_amazons3_console">link</a>.</p><p>After configuring the required settings, I created the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNQ3Gd2pfQhZIvLpQ9zhAw.png" /></figure><h3>Step 3: Uploading an Object</h3><p>After creating the bucket, I opened it and selected <strong>Upload</strong>.</p><p>For this exercise, I uploaded an image named:</p><p>Udemy-Javascript.jpg</p><p>In S3, a file uploaded into a bucket is called an <strong>object</strong>.</p><p>So, the relationship is simple:</p><p><strong>S3 → Storage service</strong></p><p><strong>Bucket → Container</strong></p><p><strong>Object → File stored in the bucket</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjHO6Ug60kmcumdC-sxJJw.png" /></figure><h3>Step 4: Configuring Public Access</h3><p>At first, I could see my image inside the AWS console, but when I copied the object’s URL and opened it directly in my browser, I received:</p><p><strong>AccessDenied.</strong></p><p>This was an important part of the learning process.</p><p>I initially thought that allowing public access would automatically make the image available to everyone. However, I learned that <strong>allowing public access and actually granting permission are two different things.</strong></p><h3>Block Public Access</h3><p>S3 has a security feature called <strong>Block Public Access</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74-UXjWYgPfNkp9QKEtiVQ.png" /></figure><p>Since this was a practical exercise that required my image to be publicly accessible, I disabled the relevant public-access blocking settings for the bucket.</p><p>However, that alone was not enough. That’s why this appears : <strong>Access denied i.e the content of the url cannot be accessed.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUpUlysrxHbU4ltYzgaIGw.png" /></figure><p>I needed to provide a permission that allowed people on the internet to read the object by adding a bucket policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klcS63XQp739tOB3e7tMVQ.png" /></figure><h3>Adding a Bucket Policy</h3><p>A bucket policy allows you to manage and enforce access permissions to the bucket and all the objects inside it at the storage layer.</p><p>I added a bucket policy that allows public users to perform the s3:GetObject action on objects inside my bucket.</p><p>The policy was:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: &quot;*&quot;,<br>      &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:s3:::your-bucket-name/*&quot;<br>    }<br>  ]<br>}</pre><p>In simple terms, this policy tells AWS:</p><p><strong>Anyone can read the objects stored in this bucket.</strong></p><p>The important part is:</p><p>&quot;Principal&quot;: &quot;*&quot;</p><p>which represents anyone, while:</p><p>&quot;Action&quot;: &quot;s3:GetObject&quot;</p><p>allows the object to be read.</p><p>Turning off <strong>Block Public Access</strong> only means AWS is <em>allowing you to create public permissions</em>. It doesn’t actually give the public permission to read your image.</p><p>Think of it as:</p><blockquote><strong><em>Block Public Access OFF</em></strong><em> → “I allow public access rules to be used.”<br> </em><strong><em>Bucket Policy</em></strong><em> → “I am giving the public permission to read this object.”</em></blockquote><h3>Step 5: Accessing the Image from a Browser</h3><p>After configuring the permissions, I copied the <strong>Object URL</strong> for my uploaded image and opened it in a browser.</p><p>This time, instead of receiving AccessDenied, the image loaded successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWn3cwn3k8Y9NfhgGY3UqA.png" /></figure><p>This confirmed that my S3 object was publicly accessible.</p><h3>What I Learned</h3><p>This exercise helped me understand S3 beyond simply knowing that it is a storage service.</p><p>The bucket analogy made the concept easier to understand:</p><blockquote><strong><em>A physical bucket stores your things. An S3 bucket stores your digital things</em>.</strong></blockquote><p>I also learned that uploading a file to S3 does not automatically make it publicly accessible. <strong>Access is controlled through AWS security settings and permissions.</strong></p><p>The key concepts I learned were:</p><ul><li><strong>S3</strong> is Amazon’s cloud object storage service.</li><li><strong>Buckets</strong> are containers for storing objects.</li><li><strong>Objects</strong> are the files stored inside buckets.</li><li><strong>Block Public Access</strong> helps prevent unintended public access.</li><li><strong>Bucket policies</strong> can define who is allowed to access objects.</li></ul><h3>Final Thought</h3><p>Cloud computing can seem complicated when you first encounter all the new terms.</p><p>But sometimes, connecting a new concept to something familiar makes it easier to understand.</p><p>A bucket stores your things.</p><p>An <strong>S3 bucket stores your digital things in the cloud.</strong></p><p>Simple enough to remember. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6bcd376d0e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OPTIMIZE SEO AND PAGE RENDERING WITH REACT HELMET]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/optimize-seo-and-page-rendering-with-react-helmet-e252b0df434a?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e252b0df434a</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Sat, 28 Oct 2023 11:36:16 GMT</pubDate>
            <atom:updated>2023-10-28T11:36:16.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t-rvxl6UqNnbm5Vl.jpeg" /></figure><p>React Helmet is a valuable tool React developers can use to enhance web applications’ SEO and user experience. By managing the document head dynamically, the search engines is provided an accurate and up-to-date information about web pages, this improves site’s visibility and rankings.</p><p>The document head includes critical elements like the page title, meta tags, links to external stylesheets, and more. These elements play a crucial role in how web pages are displayed and indexed by search engines.</p><h3>Benefits of Using React Helmet</h3><h3>1. SEO Improvement</h3><p>Properly setting metadata like page titles, meta descriptions, and open graph tags is essential for SEO. React Helmet allows you to dynamically set and update this information. For instance, you can set unique titles and descriptions for each page in your application, ensuring that search engine results accurately reflect your content.</p><h3>2. Enhanced Social Sharing</h3><p>When users share your content on social media platforms like Facebook or Twitter, the information displayed in the shared post often comes from open graph tags. React Helmet makes it easy to customize these tags, allowing for a more appealing and informative social sharing experience.</p><h3>3. Better User Experience</h3><p>A well-managed document head not only benefits search engines but also improves the user experience. Having a descriptive title and relevant meta tags can help users understand the content of a page before clicking on it in search results.</p><h3>4. Dynamic Content Management</h3><p>React Helmet is particularly valuable in dynamic single-page applications. It enables you to change the document head based on user interactions, such as when loading different sections of your app. This ensures that the information presented to search engines and users is always up to date.</p><h3>How to Use React Helmet</h3><p>With just three simple steps, you can successfully utilize React Helmet in your application, optimizing SEO and enhancing the user experience.</p><h4>Step1- Installation</h4><p>Using React Helmet in your React application is straightforward. First, you need to install the library using npm or yarn. Installing React Helmet using <strong>react-helmet </strong>library has become obsolete, you should now use <strong>react-helmet-async </strong>as written below:</p><pre>yarn add react-helmet-async<br>npm i react-helmet-asyn</pre><h4>Step 2 — Import Helmet Components</h4><p>The components to be imported from <strong>react-helmet-async</strong> includes; <strong>Helmet</strong> and <strong>HelmetProvider.</strong></p><pre>import { Helmet, HelmetProvider } from &#39;react-helmet-async&#39;;</pre><h4><strong>Helmet</strong></h4><p>Helmet in relation to HTML tags is the &lt;head&gt; tag which contain metadata.</p><h4><strong>HelmetProvider</strong></h4><p>The HelmetProvide wrap the app component to prevent memory leakage. You wrap your entire React application with the HelmetProvider at the highest level in your component hierarchy, typically in your main application file (App.js).</p><h4>Step 3— Make Use of Helmet Components</h4><ol><li><strong>Setting Head Content:</strong> Inside your components, you can use the Helmet component to set and manage the content within the &lt;head&gt; section. For example, you can set the page title, meta tags, and other head elements dynamically.</li></ol><pre>import { Helmet } from &#39;react-helmet-async&#39;;<br><br>function PageName() {<br>  return (<br>    &lt;div&gt;<br>      &lt;Helmet&gt;<br>        &lt;title&gt;Use of Helment&lt;/title&gt;<br>        &lt;meta name=&quot;description&quot; content=&quot;Learning the use of helmet&quot; /&gt;<br>        {/* Other head elements */}<br>      &lt;/Helmet&gt;<br>      {/* Page content */}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>2. <strong>Wrap Your App: </strong>Wrap your entire React application with the HelmetProvider at the highest level in your component hierarchy, in your main application file.</p><pre>import { HelmetProvider } from &#39;react-helmet-async&#39;;<br><br>function App() {<br>  return (<br>    &lt;HelmetProvider&gt;<br>      {/* All application components */}<br>    &lt;/HelmetProvider&gt;<br>  );<br>}</pre><h3>Conclusion</h3><p>Implementing React Helmet with HelmetProvider is straightforward and offers a powerful way to optimize your website’s SEO and user experience. By taking advantage of this tool, you can provide search engines and users with the most relevant information about your pages, ultimately boosting your site’s visibility and rankings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e252b0df434a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Logo Slider Using React-Slick]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/creating-a-logo-slider-using-react-slick-e8bf94a63fc3?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8bf94a63fc3</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[logo-slider]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[website-development]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 23:34:10 GMT</pubDate>
            <atom:updated>2023-06-29T00:38:01.546Z</atom:updated>
            <content:encoded><![CDATA[<p>Displaying logos of partners, sponsors, or featured companies is common practice on websites, especially on e-commerce platforms and corporate websites. One interesting and interactive way to display these logos is by using a logo slider.</p><p>In this article, we will use the react-slick library, which is a React carousel component, to create a logo slider.</p><h3>Setting up</h3><p>Firstly, make sure to install the required libraries by running the following commands in your terminal:</p><pre>npm install react-slick slick-carousel</pre><pre>npm install slick-carousel --save</pre><p>React slick also needs slick’s CSS and optionally, slick-theme’s CSS, so don’t forget to import them in your component:</p><pre>import &quot;slick-carousel/slick/slick.css&quot;; <br>import &quot;slick-carousel/slick/slick-theme.css&quot;;</pre><h3>Creating the Slider Component</h3><p>Now, we are ready to create our Slider component. We will use useState to set our slider settings:</p><pre>import React, { useState } from &#39;react&#39;;<br>import Slider from &#39;react-slick&#39;;</pre><pre>const LogoSlider = () =&gt; {<br>  const [settings] = useState({<br>    dots: true,<br>    infinite: true,<br>    slidesToShow: 3,<br>    slidesToScroll: 1,<br>    autoplay: true,<br>    speed: 2000,<br>    autoplaySpeed: 2000,<br>    cssEase: &#39;linear&#39;,<br>  });</pre><pre>  // Your component logic</pre><pre>  return (<br>    &lt;div&gt;<br>      &lt;h2&gt;Proudly Supported by&lt;/h2&gt;<br>      &lt;Slider {...settings}&gt;<br>        {/* Your logos here */}<br>      &lt;/Slider&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><pre>export default LogoSlider;</pre><p>In our settings, we have defined that the slider will display three items at a time (slidesToShow), move one item per scroll (slidesToScroll), and autoplay with a speed of 2000ms. It will also loop indefinitely (infinite: true).</p><h3>Adding Logos</h3><p>Let’s add some logos into our slider. Instead of hardcoding each logo, we can create an array of logo URLs and use the .map() function to generate the logos dynamically:</p><pre>const LogoSlider = () =&gt; {<br>  // ... settings and other stuff</pre><pre>  const logos = [<br>    &#39;http://path.to/logo1.jpg&#39;,<br>    &#39;http://path.to/logo2.jpg&#39;,<br>    &#39;http://path.to/logo3.jpg&#39;,<br>    // Add more logos here<br>  ];</pre><pre>  return (<br>    &lt;div&gt;<br>      &lt;h2&gt;Proudly Supported by&lt;/h2&gt;<br>      &lt;Slider {...settings}&gt;<br>        {logos.map((logo, index) =&gt; (<br>          &lt;div key={index} className=&quot;container&quot;&gt;<br>            &lt;img src={logo} alt=&#39;logo&#39;} /&gt;<br>          &lt;/div&gt;<br>        ))}<br>      &lt;/Slider&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><pre>export default LogoSlider;</pre><p>In the example above, the .map() function is used to iterate over the logos array. It creates a new &lt;div&gt; containing an &lt;img&gt; for each logo, with the src attribute set to the current logo URL. The alt attribute is set for accessibility and SEO purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aBVqYtRLld2CQQZxsBDQYg.png" /><figcaption>CODE SNIPPET</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m9BxqWbEpded0Zx315o5A.png" /><figcaption>Screenshot of how the logos are displayed on the browser</figcaption></figure><p>That’s it! You’ve successfully created a logo slider using React and react-slick. This pattern isn’t limited to logos — you can use it to create sliders for various types of content by changing the items in the array.</p><p>Remember to customize the settings to fit your needs and feel free to add your own styles to make the slider match your site’s look and feel. React-slick comes with a multitude of options for customization, so explore the <a href="https://react-slick.neostack.com/">official documentation</a> to learn more.</p><p>Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8bf94a63fc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Quickly Fix Common Robots.txt Issues for Your Website]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/how-to-quickly-fix-common-robots-txt-issues-for-your-website-c767c3472c3c?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c767c3472c3c</guid>
            <category><![CDATA[robotstxt]]></category>
            <category><![CDATA[google-search-console]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[visibility]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Wed, 10 May 2023 00:47:35 GMT</pubDate>
            <atom:updated>2023-05-10T00:53:09.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Hq98ySxV_BMItbQII1paw.png" /></figure><p>Google Search Console is a powerful tool that allows website owners and webmasters to monitor the performance of their website in Google’s search results. One of the key features of Search Console is the ability to identify and fix page indexing issues, such as those caused by blocked robots.txt files.</p><p>In this article I will explain how to fix the issue “<strong>Page is not indexed, blocked by robots.txt </strong>”. To improve comprehension, I will explain the Page indexing issues and Robots.txt function for Google Search Console.</p><h4>Page Indexing Issues</h4><p>Page indexing issues occur when Google is unable to crawl and index a page on your website. This can happen for a variety of reasons, such as a misconfigured robots.txt file, server errors, or content that is not optimized for search engines.</p><h4>Robots.txt</h4><p>The robots.txt file is a text file that sits in the root directory of your website and tells search engine robots which pages or sections of your website they are allowed to access and index. If a page on your website is being blocked by the robots.txt file, it means that Google’s search bots won’t be able to crawl and index that page.</p><h4>How to Fix Page Indexing Blocked by Robots.txt</h4><p>If you see any errors related to page indexing, such as “Page is not indexed, page blocked by robots.txt file ”, it means that Google is not able to index that page. You need to update the file to allow Google to crawl and index the page.</p><h4>Step1 — Check for page indexing issues in Search Console.</h4><p>Follow these steps:</p><ol><li>Log in to your Google Search Console account.</li><li>Select the website for which you want to check for indexing issues.</li><li>Click on the “Index” menu, and then select “Pages”.</li><li>Look for any “Errors” or “Valid with warnings” issues related to page indexing. You will be able to find the page(url) with the issue.</li></ol><h4>Step 2 — Locate the “robots.txt” file</h4><p>This file is usually located in the root directory of your website, e.g., “<a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbl9GTkRmdzFmYlB0VWdxblJGT0p0dGR6YVZ1d3xBQ3Jtc0tsZ01SeVJHUGxVRUItLTdFLTV2S1FFaXBfd2ZMeG84RDJ0bmwxWC16eWMzU0tQUjcwTVJjZVk3TGhtbUxqdFBfbzdkX0d5bER1T0o4U3NCaF9WcE9reW53MEh1MUxZR3dWMVdWZ3h5blFJR19JYndQTQ&amp;q=https%3A%2F%2Fwww.gomahamaya.com%2Frobots.txt&amp;v=aX14-DxJR-w">https://example.com/robots.txt</a>&quot;. You can access it by entering the URL in your browser. change your website URL with example.com</p><h4><strong>Step 3 — Edit the “robots.txt” file:</strong></h4><p>If you find any pages(url) that are being blocked by the robots.txt file, you need to update the file to remove any “Disallow” directives that are blocking those pages.</p><p>For example using the below as your robots.txt file</p><pre>User-agent: *<br>Disallow:/about</pre><p>The “<a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbl9GTkRmdzFmYlB0VWdxblJGT0p0dGR6YVZ1d3xBQ3Jtc0tsZ01SeVJHUGxVRUItLTdFLTV2S1FFaXBfd2ZMeG84RDJ0bmwxWC16eWMzU0tQUjcwTVJjZVk3TGhtbUxqdFBfbzdkX0d5bER1T0o4U3NCaF9WcE9reW53MEh1MUxZR3dWMVdWZ3h5blFJR19JYndQTQ&amp;q=https%3A%2F%2Fwww.gomahamaya.com%2Frobots.txt&amp;v=aX14-DxJR-w">https://example.com/</a>about” is the page (url) with indexing issue. To fix this, you remove the page from the “Disallow”.</p><pre>User-agent: *<br>Disallow:</pre><p>You have successfully disallow the page index from being blocked.</p><h4>More Indexing Cases</h4><p>If you want Google to index your entire website, your robots.txt file should look like this:</p><pre>User-agent: *<br>Disallow:</pre><p>If you have specific pages or directories that you want to block from being indexed, you can modify the code accordingly. For example, if you wanted to block the /private directory from being indexed, you would add the following line to the code:</p><pre>User-agent: *<br>Disallow: /private/</pre><p>To permit certain pages to be indexed by search engines, you can include a “Allow” directive in your website’s robots.txt file. This directive specifies the pages or directories that the search engine robots are allowed to access and index. For example, if you want to allow the search engine robots to index a page located at “<a href="https://www.example.com/my-page/">https://www.example.com/my-page/</a>&quot;, you can add the following code to your robots.txt file:</p><pre>User-agent: *<br>Allow: /my-page/<br>Disallow: /private/</pre><h4>Step 4 — Submit a reindex request</h4><p>After making changes to the “robots.txt” file, you may need to submit a request to the search engine to reindex your website. This will allow the search engine to discover the changes you made and update its index accordingly.</p><p>Please note that changes to the “robots.txt” file may take some time to take effect, as it may take a while for search engines to recrawl your site.</p><h4>Note</h4><p>You may get an indexing issue for the page(s) you want to hide from everyone using the disallow, you may then remove the page (url ) from indexing in your google search console account.</p><h4>Conclusion</h4><p>By checking for errors in Google Search Console and looking for disallow directives, you can quickly fix common robots.txt issues. These methods ensure that your website’s pages are being crawled and indexed by search engine robots as intended. By taking the necessary steps to fix any issues with your robots.txt file, you can improve your website’s search engine visibility and ultimately drive more traffic to your site.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c767c3472c3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide To React Hooks For Beginners]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/a-comprehensive-guide-to-react-hooks-for-beginners-a1377cf1da38?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1377cf1da38</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[user-interface]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 00:24:12 GMT</pubDate>
            <atom:updated>2023-03-27T11:39:25.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4y_agAUY2MzDQbZ18a2RAg.png" /></figure><p>As someone new to React, it can be overwhelming to figure out how to use various tools. Despite becoming comfortable with a couple of hooks like useState and useEffect , it still took me a while to grasp the usage of other React hooks. Perhaps you’re also unfamiliar with how to use React hooks, this article will assist you in comprehending the concept more quickly.</p><p><strong>Prerequisites</strong></p><p>Before we dive into React Hooks, it’s important to have a basic understanding of React components and JSX syntax. If you’re not familiar with these concepts, it might be helpful to take a beginner-level course or tutorial before continuing.</p><p>It’s also helpful to have a basic understanding of JavaScript, particularly the ES6 syntax and concepts such as arrow functions, classes, and destructuring.</p><p><strong>What are React Hooks?</strong></p><p>If I had to describe React hooks, I would say they handle various tasks within components such as managing state, global state, side effects, and component functionalities. A state is used to store values that may change from their initial value and can hold different data types such as integers, booleans, arrays, objects, and more. When the state of a component changes, React automatically re-renders the component and updates the user interface to reflect the new state.</p><p>Hooks enable developers to reuse stateful logic across different components, resulting in more concise and reusable code. Overall, React Hooks make it easier for developers to build and maintain scalable and flexible React applications.</p><p>There are several types of Hooks, each serving a different purpose, and they provide a way to reuse stateful logic between components without the need for inheritance.</p><h4>Types of React Hooks</h4><ol><li>UseState —State</li><li>UseEffect — Side Effects</li><li>Use Context — Context API</li><li>Use Reducer — Reducers</li><li>UseRef</li><li>Use Memo</li><li>Use CallBack</li><li>Custom Hooks — customized</li></ol><h4><strong>The UseState Hook</strong></h4><p>The useState Hook is used to manage the state in functional components. It takes an <em>initial state</em> value as a parameter and <em>returns an array with two values</em>: the current state value and a function to update the state.</p><p>Example of how to use useState to manage a counter:</p><pre>//import usestate from react<br><br>import React, { useState } from &#39;react&#39;;<br><br>function Counter() {<br><br>// count is the intial state, useState holds the initial value<br>// setCount is the updated state that holds the updated value <br><br>  const [count, setCount] = useState(0);<br><br>  function handleIncrement() {<br>    setCount(count + 1);<br>  }<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;Count: {count}&lt;/p&gt;<br>      &lt;button onClick={handleIncrement}&gt;Increment&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>In this example, we use the useState Hook to manage the count state. We define the initial state value as 0 and use the setCount function to update the state when the button is clicked.</p><h4>The UseEffect Hook</h4><p>The useEffect Hook is used to perform side effects in functional components. Side effects can include fetching data from an API, manipulating the DOM. The useEffect Hook takes a function as a parameter and executes it after the component has rendered i.e useEffect is called after every render.</p><p>To conditionally run an effect, we specify a second parameter to useEffect. The second parameter is the array of values that the effect depends on.</p><p>Example of how to use useEffect to update DOM(title):The document title is updated as the useState value updates(number) i.e clicking on the IncreaseNumber button also updates the DOM element(title)</p><pre>// import useEffect from &#39;react&#39;<br>//The useState handles the state (number)<br>// The effect depends on the state value(number), we passed this as the second parameter<br><br>import React, { useEffect, useState } from &quot;react&quot;;<br><br>const UseEffect = () =&gt; {<br>  const [number, setNumber] = useState(0);<br><br>  useEffect(() =&gt; {<br>    document.title = `You clicked ${number} times`;<br>  }, [number]);<br>  return (<br>    &lt;div&gt;<br>      &lt;button<br>        onClick={() =&gt; {<br>          setNumber(number + 1);<br>        }}<br>      &gt;<br>        IncreaseNumber<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default UseEffect;</pre><p>In this example, we use useState Hook to handle the number state. And useEffect to update the DOM element , this renders whenever the number state updates i.e it rendering depends on the state(number), this will be the second parameter ,the array value.</p><p>Using useEffect to fetch API data using JSON placeholder</p><pre>import React, { useState, useEffect } from &#39;react&#39;;<br><br>function DataFetcher() {<br>  const [data, setData] = useState([]);<br><br>  useEffect(() =&gt; {<br>    fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;)<br>      .then(response =&gt; response.json())<br>      .then(data =&gt; setData(data));<br>  }, []);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;ul&gt;<br>        {data.map(item =&gt; (<br>          &lt;li key={item.id}&gt;{item.name}&lt;/li&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p><strong>The UseContext Hook</strong></p><p>To understand the usage of UseContext well, we consider a React App that have many components i.e components and in components. If these components then needs to access the same data across the application, we make use of useContext hook for easy consumption of the data. This provides a way to pass data through the component tree without having to pass it down manually on every level.</p><h4>Steps in Creating Context</h4><p><strong>Step 1 — Create Context in App.js</strong></p><pre>export const UserContext = React.createContext();</pre><p><strong>Step2 — Provide context with a value to be available.</strong> The child/children component must be enclosed in the provider, for the value to be available.</p><pre>&lt;MyContext.Provider value=&quot;Victoria&quot;&gt;<br>      &lt;MyComponent /&gt;<br>    &lt;/MyContext.Provider&gt;</pre><p><strong>Step3 — We then use the</strong><strong> </strong>useContext<strong> hook:</strong> Used in Mycomponent.js to consume the value.</p><p>(i) Import useContext</p><p>(ii) Import the UserContext from App.js</p><p>(iii) Call the useContext function. It takes the context as an argument and returns the current value of the context.</p><pre>import React, { useContext } from &quot;react&quot;;<br><br>import {UserContext} from ./App<br><br>const MyComponent=() =&gt; {<br><br>const username = useContext (UserContext);<br><br> return (<br>    &lt;div&gt;<br>      {username} <br>    &lt;/div&gt;<br>  );<br>}</pre><p>When the MyComponent component is rendered, it will display the value &quot;Victoria&quot;, which was passed down through the context from the App component. If we had multiple components that needed access to the same data, we could pass the value down through the context once and then have all the components consume it using the useContext hook.</p><h4>The useReducer Hook</h4><p>useReducer is a hook used for state management , more structured and predictable way than using the useState . This hook works in comparism the reduce() method in JavaScript, both involve reducing an array of values to a single value/ a pair of values. The useReducer hook returns a pair of values using array distructuring syntax, similar to useState .</p><p>The useReducer hook takes in two arguments: a <strong>reducer</strong> function and an <strong>initial state</strong>. The reducer function is responsible for handling state updates and returning a new state. It takes in two arguments: the <strong>current state</strong> and an <strong>action </strong>object that describes what kind of update needs to be performed.</p><pre>useReducer(reducer, initialState)<br><br>newState= reducer(currentState, action)</pre><p>The useReducer hook returns a pair (array) of values: the <strong>current state </strong>and a <strong>dispatch</strong> function. The dispatch function is used to trigger state updates and takes in an action object as its argument. When the dispatch function is called, React will call the reducer function with the current state and the action object, and then use the return value as the new state .dispatch allows us to execute a code corresponding to a particular action.</p><pre>useReducer= const [currentState, dispatch]<br>//Recall useReducer takes two arguments<br><br>const [currentState, dispatch] = useReducer(reducer, initialState)</pre><p>Now, we want to see how we can use useReducer hook to create a counter App.</p><p><strong>Step 1 — Import useReducer from react</strong></p><p><strong>Step 2 — Defining the initial state and reducer function</strong></p><p><strong>Step 3 —</strong> <strong>Get value to display and call the useReducer function.</strong> Dispatch allows us to execute a code corresponding to a particular action.</p><p>Below is what the code look like following the steps:</p><pre>//Import useReducers from React<br>import React, { useReducer } from &quot;react&quot;;<br><br>// Define the initial state<br>const initialState = 0;<br><br>// defining reducer function<br>const reducer = (state, action) =&gt; {<br>  switch (action) {<br>    case &quot;increment&quot;:<br>      return state + 1;<br>    case &quot;decrement&quot;:<br>      return state - 1;<br>    case &quot;reset&quot;:<br>      return initialState;<br><br>    default:<br>      return state;<br>  }<br>};<br><br>const UseReducer = () =&gt; {<br>// call the useReducer function<br>  const [count, dispatch] = useReducer(reducer, initialState);<br><br>  return (<br>// display the counter app, using dispatch to execute the action.<br>    &lt;div&gt;<br>      &lt;div&gt;{count}&lt;/div&gt;<br><br>      &lt;button<br>        type=&quot;button&quot;<br>        onClick={() =&gt; {<br>          dispatch(&quot;decrement&quot;);<br>        }}<br>      &gt;<br>        Decrement<br>      &lt;/button&gt;<br>      &lt;button<br>        type=&quot;button&quot;<br>        onClick={() =&gt; {<br>          dispatch(&quot;reset&quot;);<br>        }}<br>      &gt;<br>        Reset<br>      &lt;/button&gt;<br>      &lt;button<br>        type=&quot;button&quot;<br>        onClick={() =&gt; {<br>          dispatch(&quot;increment&quot;);<br>        }}<br>      &gt;<br>        Increment<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default UseReducer;</pre><p>In this example, we define a reducer function that takes in the current state and an action object. The action object has a type property that describes what kind of update needs to be performed. In this case, we’re defining three actions: increment, decrement and reset, which will increase , decrease and reset the count respectively.</p><p>We then define a component that uses the useReducer hook to manage the state of our count variable. We pass in the reducer function and the initial state declared (initialState=0) as arguments to the useReducer hook.</p><p>The Counter component then returns a JSX template that displays the current count and three buttons that use the dispatch function to trigger state updates. When the dispatch function is called with an action object, React will call our reducer function with the current state and the action object and use the return value as the new state.</p><p>Other ways to use useReducer hook in your application includes:</p><ol><li>Using UseReducer to maintain both state and action as objects</li><li>We can use UseReducer and useContext for global state management</li><li>Fetching Data using useReducer Hook.</li></ol><p>I have all these examples in my GitHub repo that will be attached to the end of this article.</p><p><strong>The useRef Hook</strong></p><p>The useRef hook makes it possible to access DOM elements directly or to store mutable values that persist across renders(within effect). The useRef hook takes an initial value as its argument and returns a mutable ref object with a current property.</p><p>This code example demonstrates how to use the useRef hook in conjunction with the useEffect hook to focus an input element when a component is mounted.</p><pre>import React, { useEffect, useRef } from &quot;react&quot;;<br><br>const UseRefHook = () =&gt; {<br>  const inputRef = useRef(null);<br><br>  useEffect(() =&gt; {<br>    //focus the input element<br>    inputRef.current.focus();<br>  }, []);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;Using useRef for input focus&lt;/p&gt;<br>      &lt;input ref={inputRef} type=&quot;text&quot; /&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default UseRefHook;</pre><p>In this example, we define a functional component called UseRefHook. Inside the component, we create a ref using the useRef hook and assign it to the inputRef variable. We then use the useEffect hook to call a function that focuses on the input element using the current property of the inputRef object. The second argument to the useEffect hook is an empty array [], which ensures that the effect runs only once, when the component mounts.</p><p>Finally, we return some JSX that includes a paragraph element and an input element that uses the inputRef reference.</p><p>By using useRef in conjunction with useEffect, we can ensure that the input element is focused when the component is first mounted. This can be particularly useful in cases where the input element is a crucial part of the user experience, such as in a search box or a login form.</p><h4>UseMemo and UseCallback hooks</h4><p>useMemo and useCallback are two hooks in React that are used for performance optimization. Both of these hooks are used to memoize or cache the results of an expensive computation, so that the computation does not need to be repeated every time a component re-renders. However, they are used in slightly different contexts.</p><p>The useMemo hook is used to memoize the result of a function call. It takes two arguments - a function and an array of dependencies. The function is the expensive computation that we want to memoize, and the dependencies are the values that the function depends on. React will re-run the function and recompute the result only when any of the dependencies change.</p><pre>import React, { useState, useMemo } from &quot;react&quot;;<br><br>const MemoHook = () =&gt; {<br>  const [counterOne, setCounterOne] = useState(0);<br>  const [counterTwo, setCounterTwo] = useState(0);<br><br>  const IncrementOne = () =&gt; {<br>    setCounterOne(counterOne + 1);<br>  };<br>  const IncrementTwo = () =&gt; {<br>    setCounterTwo(counterTwo + 1);<br>  };<br><br>  const Even = useMemo(() =&gt; {<br>    let i = 0;<br>    while (i &lt; 2000000) i++;<br>    return counterOne % 2 === 0;<br>  }, [counterOne]);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;div&gt;<br>        &lt;h1&gt;Using MemoHook&lt;/h1&gt;<br>        &lt;button onClick={IncrementOne}&gt; Counter-One {counterOne}-&lt;/button&gt;<br>        &lt;span&gt;{Even() ? &quot;Even&quot; : &quot;odd&quot;}&lt;/span&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        {&quot; &quot;}<br>        &lt;button onClick={IncrementTwo}&gt;Count-Two {counterTwo}&lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default MemoHook;</pre><p>In the given code, useMemo is used to memoize the result of a function that checks if the counterOne value is even or odd. The function is called Even and it&#39;s defined inside the component. The function uses a loop to delay the execution, which simulates an expensive computation.</p><p>The second argument of useMemo is an array of dependencies, which tells React to recompute the memoized value whenever any of the dependencies change. In this case, the only dependency is counterOne, so the memoized value will only be recomputed when counterOne changes.</p><p>The memoized value is then used in the JSX to display “Even” or “odd” depending on the value of counterOne. This means that the expensive computation of Even only happens when counterOne changes, and not on every render of the component.</p><p>The useCallback will return a memoized version of the callback version that only changes if one of the dependencies has changed.</p><p>To catch function — useCallback</p><p>To catch result — useMemo</p><h4>The Custom Hooks</h4><p>Custom hook simply means a customized way of creating reusable logic. A custom hook is a function that uses one or more built-in React hooks (such as useState, useEffect, useContext, etc.) and returns stateful data and functions that can be used by other components.</p><h4><strong>How To Create and use a Custom Hook</strong></h4><p><strong>Creating a Custom Hook</strong></p><p><strong>Step 1 — Identify the reusable logic</strong>: Determine what code can be extracted into a separate function to make it reusable across components.</p><p><strong>Step 2 —</strong> <strong>Create a new function : </strong>The function name must start with use<strong> (</strong>keyword used to represent an hook<strong>) </strong>that will hold the reusable logic. This function should use one or more built-in React hooks, this is the custom hook.</p><p><strong>Step 3 — Define the hook’s return value:</strong> Determine what data or functions should be returned from the hook.</p><p><strong>Step 4 —</strong> <strong>Export the custom hook:</strong> Export the new function as a custom hook.</p><p>Example: Counter App CustomHook</p><pre>import { useState } from &quot;react&quot;;<br>//using useCounter hook instead of repeating the same code for components<br>//reusable logic<br>//Hook named useCounter<br><br>const useCounter = (initialCount = 0, value) =&gt; {<br>  const [count, setCount] = useState(initialCount);<br><br>  const decrement = () =&gt; {<br>    setCount((prevCount) =&gt; prevCount - value);<br>  };<br>  const increment = () =&gt; {<br>    setCount((prevCount) =&gt; prevCount + value);<br>  };<br>  const reset = () =&gt; {<br>    setCount(0);<br>  };<br><br>//we return an array of values: count, inc, dec, and reset<br>  return [count, increment, decrement, reset];<br>};<br>//export useCustom<br>export default useCounter;</pre><p><strong>Using a custom hook</strong></p><ol><li><strong>Import the custom hook:</strong> Import the custom hook into the component where it will be used.</li><li><strong>Call the custom hook:</strong> Call the custom hook inside the component. This will return the data or functions that were defined in the hook.</li><li><strong>Use the returned values:</strong> Use the returned data or functions in the component as needed.</li></ol><pre>import React from &quot;react&quot;;<br>// import the custom hook<br><br>import useCounter from &quot;./useCounter&quot;;<br><br>const CustomHooksComponent1 = () =&gt; {<br>//use the custom hook and its logics in the component <br><br>  const [count, increment, decrement, reset] = useCounter(10, 2);<br>  return (<br>    &lt;div&gt;<br>      CustomHooksComponent1<br>      &lt;div&gt;<br>        &lt;p&gt;CustomHook1- {count}&lt;/p&gt;<br>        &lt;button onClick={decrement}&gt;Decrement&lt;/button&gt;<br>        &lt;button onClick={increment}&gt;Increment&lt;/button&gt;<br>        &lt;button onClick={reset}&gt;Reset&lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default CustomHooksComponent1;</pre><p>The useCounter hook takes two arguments, an initial count value of 10 and a step value of 2, and returns an array containing the current count value, a function to increment the count, a function to decrement the count, and a function to reset the count to its initial value.</p><p>The component then uses these values to render a simple counter UI with three buttons to increment, decrement, and reset the count value. When the user clicks on one of these buttons, the corresponding function from the useCounter hook is called to update the count state and re-render the component with the new count value.</p><p>Overall, this component demonstrates how a custom hook can be used to encapsulate complex state logic and make it reusable across multiple components. By using the useCounter hook, the CustomHooksComponent1 component can manage its own count state without having to write any custom state management code.</p><h4>Conclusion</h4><p>React hooks are a powerful and flexible feature that allows developers to write more modular and reusable code in their React applications. Whether you need to manage component state, fetch data from an API, or interact with the browser DOM, there is likely a hook that can help you accomplish your task more efficiently.</p><p>While it can take some time to get comfortable with the different types of hooks and their various use cases, the benefits of using hooks can be substantial, including improved code readability, easier debugging, and faster development times.</p><h4><strong>Final Piece</strong></h4><p>If you’re interested in learning more about React hooks and how they work in practice, you’re in luck! I’ve put together a comprehensive <a href="https://github.com/VictoriaOluwaferanmi/ReactHooks.git">Github</a> repository that includes code examples for all the most important React hooks to help you understand how they work.</p><p>It’s such a long one right? Yea! we just covered all the React Hooks.</p><p><strong>Thank you for taking the time to read this article. I hope that it has given you a better understanding of how to use React hooks effectively in your own projects.</strong></p><p><a href="https://github.com/VictoriaOluwaferanmi/ReactHooks.git">https://github.com/VictoriaOluwaferanmi/ReactHooks.git</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1377cf1da38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating React Apps with npx (The Hassle-Free Alternative to npm)]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/creating-react-apps-with-npx-the-hassle-free-alternative-to-npm-4d5a5a4c2327?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d5a5a4c2327</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[npx]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 04:20:01 GMT</pubDate>
            <atom:updated>2023-03-06T04:23:00.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oSMkR5-Lt84olJmafvC8Wg.png" /></figure><p><strong>React</strong> has become one of the most popular JavaScript libraries for building user interfaces, and for good reason. Its simplicity, flexibility, and component-based architecture make it a powerful tool for creating modern web applications. However, getting started with React can be daunting, especially for new developers who may not be familiar with the tools and workflows involved.</p><p>One of the first steps in creating a React app is setting up your development environment. This includes installing Node.js, a popular JavaScript runtime environment, and a package manager such as npm (Node Package Manager). npm allows you to install and manage packages and dependencies for your project and is a key part of the Node.js ecosystem. However, when it comes to creating a new React app, using npm may not be the best option.</p><p>In this article, we’ll explore why you should use<strong> </strong>npx to create React apps instead of npm, and how this can simplify your development workflow.</p><h4>What is npm?</h4><p>npm ( <strong>Node Package Manager</strong>) is a package manager that comes bundled with Node.js. It allows you to install and manage packages and dependencies for your projects, and is an essential tool for JavaScript development. npm maintains a registry of packages, which contains a vast collection of open-source libraries and tools that you can use in your projects. When you install a package using npm, it’s stored in a global cache on your machine, which you can access from any directory.</p><h4>What is npx?</h4><p>npx is a command-line tool that was introduced in npm <em>version 5.2.0</em>. It stands for &quot;<strong>Node Package Execute</strong>&quot; and is used to execute packages without the need to install them globally. npx allows you to run a command-line tool, like a script or a binary, from an npm package. It downloads the package, runs the specified command, and then removes the package. npx is included with npm, so if you have npm installed, you also have npx.</p><h4>Using npm to Create React Apps</h4><p>To create a new React app, you can use the official Create React App tool. Traditionally, this involved installing the tool globally using npm:</p><pre>npm install -g create-react-app</pre><p>Once installed, you could run the following command to create a new React app:</p><pre>create-react-app my-app</pre><h4>Using npx to Create React Apps</h4><p>However, with npx , you can skip the installation step and run the command directly:</p><pre>npx create-react-app my-app</pre><p>This command does <strong>two things</strong>: <strong>first</strong>, it <em>checks </em>if you have the Create React App tool in your local cache. If you don’t, it <em>downloads</em> the latest version and installs it temporarily for the duration of the command.<strong> Second</strong>, it<em> runs</em> the tool and <em>generates </em>a new React app in a directory called my-app.</p><h4>Why You Should Use npx Instead of npm?</h4><ol><li><strong>No global installation</strong>: With npx, you don’t have to worry about installing the Create React App tool globally on your machine. This can save you disk space and prevent potential conflicts with other tools and packages.</li><li><strong>Latest version</strong>: When you use npx to run a tool, it automatically downloads and uses the latest version available in the registry. This means you can be sure you’re using the most up-to-date version of the tool, with all the latest features and bug fixes.</li><li><strong>Simplified workflow</strong>: Using npx eliminates the need to manage different versions of the same tool, and can simplify your development workflow. You can run a tool directly from your local cache, without having to worry about installation or updating.</li><li><strong>Less clutter</strong>: By not installing tools globally, you can avoid cluttering your global namespace with unnecessary packages and dependencies. This can make it easier to manage your local environment and avoid conflicts.</li></ol><h3>Conclusion</h3><p>npm is used to manage packages and dependencies for your project, while npx is used to execute packages without having to install them globally or add them as a dependency to your project.</p><p>While npm is an essential tool for managing packages and dependencies in your Node.js projects, using npx to create React apps can simplify your workflow and eliminate potential conflicts and compatibility issues. With npx, you can run CLI tools directly from your local cache, without having to worry about installation or version management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d5a5a4c2327" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why User Research Should be a Priority in Your Design Process]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/why-user-research-should-be-a-priority-in-your-design-process-245e40e9c807?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/245e40e9c807</guid>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[user-research]]></category>
            <category><![CDATA[user-experience]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 12:45:06 GMT</pubDate>
            <atom:updated>2023-02-28T12:45:06.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0OjX8BoRMJUH8P3aVYowg.jpeg" /></figure><p>As a designer, creating visually stunning designs is undoubtedly one of your top priorities. However, it’s important to remember that good design goes beyond aesthetics. At its core, design is about problem-solving, and to solve problems effectively, you need to have a deep understanding of your users and their needs. This is where user research comes in. By conducting user research, designers can gain valuable insights into their users’ behaviors, preferences, and pain points.</p><p>In this article, we’ll dive into what user research is, why it’s essential, and the different methods you can use to conduct it effectively.</p><h4>What is User Research</h4><p>User research is the process of gathering and analyzing information about your target users to better understand their needs, behaviors, preferences, and pain points. The goal of user research is to gain insights that can help inform the design of a product or service that is tailored to the users’ needs and is easy to use. User research involves a variety of methods, such as interviews, surveys, usability testing, focus groups, and observational studies. By conducting user research, designers and developers can make informed decisions and create products that meet the needs and expectations of their users.</p><h4>Importance of User Research in the Design Process</h4><p>As a designer, it can be tempting to focus solely on creating visually impressive designs. However, design encompasses more than just aesthetics; it involves addressing issues for your users. To achieve this effectively, it is essential to have a good understanding of your users and their requirements. This is where user research plays a crucial role.</p><ol><li>It saves time and resources</li></ol><p>User research helps you identify design problems early on in the process. By gathering feedback from your users before you start designing, you can avoid costly redesigns down the line. User research can also help you prioritize features and functionalities based on what your users actually need, which can save you time and resources.</p><p>2. It improves the user experience</p><p>By understanding your user’s needs and preferences, you can create digital products that are intuitive and easy to use. User research can help you identify pain points in your users’ journey and address them in your design. By prioritizing the user experience, you can create digital products that your users will love.</p><p>3. It sets your digital product apart</p><p>User research can help you identify gaps in the market and differentiate your digital product from your competitors. By understanding your target audience’s behavior and preferences, you can create a unique user experience that sets your digital product apart.</p><p><strong>User Research Methods</strong></p><p>So, how do you conduct user research? There are many methods you can use, including <strong>surveys</strong>, <strong>user</strong> <strong>interviews</strong>,<strong> </strong>and <strong>usability tests</strong>. The key is to involve your target audience throughout the design process. By gathering feedback from your users at every stage of the process, you can create a digital product that truly meets their needs.</p><h4>Conclusion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*yF_-dNfF6RpStbi8W36L7Q.png" /></figure><p>User research should be a priority in your design process. By understanding your users’ behavior, preferences, and pain points, you can create digital products that solve their problems and meet their needs. User research can save you time and resources, improve the user experience, and set your digital product apart.</p><p>Therefore, it’s crucial not to underestimate the importance of user research in your design process — taking the time to understand your users will ultimately benefit their experience and show them that their needs are valued.</p><p>Hopefully, this article shed some light on the importance of user research.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=245e40e9c807" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[USING WEBSITE LOGO AS FAVICON]]></title>
            <link>https://victoriaoluwaferanmi.medium.com/using-website-logo-in-browser-tabs-b25369114c9e?source=rss-da1bf9d78cf7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b25369114c9e</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[favicon]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Victoria Oluwaferanmi]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 22:33:08 GMT</pubDate>
            <atom:updated>2023-01-12T23:20:36.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIsa-DwZ5nQ4cMY7BOl4jg.png" /></figure><h3>Introduction</h3><p>In this article, we will learn how to use our website logo as a favicon or browser logo.</p><p><strong>Favicon</strong> or browser icon is a small image mostly a website logo displayed next to the page title on the<strong> browser tab</strong>. A Favicon is a key recognition of a website in browser tabs, history, bookmarks, and address bar, that is why the website logo is majorly used as a favicon image/icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4VqWsO50mEFiLAmlagwUw.png" /></figure><h3>Prerequisites</h3><p>Basic understanding of how to<a href="https://reactjs.org/docs/create-a-new-react-app.html"> create react app</a>.</p><p>Understand how to locate files from different directories/folders of your project i.e<strong> path.</strong></p><p><em>Let’s dive in</em></p><p><strong>Step 1 — Locate React Favicon</strong></p><p>The react favicon is located in the public folder. This is what we want to replace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZM4yuQLqRH26H1zaUKm9A.png" /></figure><p><strong>Step 1 — Add Your Website Favicon</strong></p><p>This is the icon you want your website to display in browser tabs, bookmarks, history, and address bar. The Optimal size for the <strong>favicon</strong> is <strong>16x16 pixels</strong>. Place the icon in the<strong> Public</strong> folder, the image (icon) should be named<strong> favicon.ico</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roZ8i0U6aCbO8Aq_wjs9_g.png" /></figure><p><strong>Step 2— Link icon path</strong></p><p>Open the <strong>Index.html file</strong>, this is where we will link the favicon to the website using the link tag. The <strong>href</strong> value is the <strong>favicon path</strong>.</p><pre><br>&lt;link rel=&quot;icon&quot; href=&quot;%PUBLIC_URL%/favicon.ico&quot; /&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JJwbcwT0wDIKmpKjUpVDA.png" /></figure><p><strong>Step 3— Start React App</strong></p><pre>npm start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8wIBcMRcFFs8Uu_ezNXzUQ.png" /></figure><p>We have successfully replaced react favicon with our website favicon( website logo). We now have our logo showing in the browser tab.</p><p><em>Done!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b25369114c9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>