Adding Favicon In React App

Ujjawal Kumar
1 min readMar 27, 2023

--

To add a favicon to your React app, you can follow these steps:

  1. Create a favicon.ico file: You can use an image editor to create a .ico file with the icon you want to use.
  2. Place the favicon.ico file in the public directory: Create a public directory in the root of your React app if it doesn't exist already. Place the favicon.ico file in this directory.
  3. Add the link tag to your HTML: Open the public/index.html file and add the following link tag to the <head> section:
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />

This will link to the favicon.ico file in the public directory.

  1. Restart your development server: If your development server is already running, you will need to stop it and restart it for the changes to take effect. Once you have completed these steps, you should see your favicon in the browser tab and address bar.

--

--

Ujjawal Kumar
Ujjawal Kumar

Written by Ujjawal Kumar

Hi there, I am Ujjawal, programmer with a keen interest in problem-solving and developing new software that will add value to the community.

No responses yet