简体   繁体   English

当我尝试将反应项目中的 favicon 重命名为“favicon.ico”时,图标更改为反应徽标

[英]When I try to rename a favicon in a react project to "favicon.ico" the icon changes to react logo

before renaming改名前

After renaming same file重命名同一个文件后

without naming the file "favicon.ico" is there any other option to add favicon to a react project ?在不命名文件“favicon.ico”的情况下,还有其他选项可以将 favicon 添加到 react 项目吗?

This is a problem that can occur when in development.这是在开发时可能出现的问题。 When building the project, it will load at the new favicon.构建项目时,它将在新的 favicon 处加载。 If that doesn't work the case may be with browser cookies, try erasing your cookies and then the new favicon will show.如果这不起作用,则可能是浏览器 cookie,请尝试删除您的 cookie,然后新的网站图标将显示。

Check all the modules being loaded in your client app and see if any are importing the logo:检查客户端应用程序中加载的所有模块,看看是否有任何模块正在导入徽标:

 import logo from '../logo.svg';

Your default favicon might be being overridden by the React things您的默认网站图标可能被 React 事物覆盖

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM