Victor
Victor

Reputation: 403

How to change the default logos in create-react-app

I'm working on a create-react-app project in VS code and would like to change the default logos (specifically the one that appears in the tab to the left of the website title). I have an image that I would like to use, but I can't figure out how to add the image to VS code. I tried making a .png file, but wasn't able to add the picture into the file. I tried the same thing with a .ico file. I honestly don't understand the difference between the two. But if someone could help me with steps on how to change that logo (blue atom looking thing) that would be great.

Upvotes: 0

Views: 1487

Answers (2)

Victor
Victor

Reputation: 403

Easiest way to do it is to create the image as a .ico file, then drag and drop it into your public folder. There should already be a file named favicon.ico, just delete that file and rename the one you just dropped as favicon.ico, that way you don't have to change any of the code

Upvotes: 0

This depends on how you want to put it.

add to html file(probably index.html)

<link rel="icon" href="pathname">

add Node.js file assuming that you are also using express.

var favicon=require("serve-favicon");
app.use(favicon("pathname"));

Upvotes: 0

Related Questions