how to add favicon in html
<link rel="shortcut icon" type="image/png" href="Link to the image"/>
how to add favicon in html
<link rel="shortcut icon" type="image/png" href="Link to the image"/>
change title react
import React from 'react'
import ReactDOM from 'react-dom'
class Doc extends React.Component{
componentDidMount(){
document.title = "dfsdfsdfsd"
}
render(){
return(
<b> test </b>
)
}
}
ReactDOM.render(
<Doc />,
document.getElementById('container')
);
how to change favicon dynamic in react js
import React from "react";
function getFaviconEl() {
return document.getElementById("favicon");
}
function App() {
const handleGoogle = () => {
const favicon = getFaviconEl(); // Accessing favicon element
favicon.href = "https://www.google.com/favicon.ico"; };
const handleYoutube = () => {
const favicon = getFaviconEl();
favicon.href = " https://s.ytimg.com/yts/img/favicon-vfl8qSV2F.ico"; };
return (
<div className="App">
<h1>Dynamically changing favicon</h1>
<button onClick={handleGoogle}>Google</button> <button onClick={handleYoutube}>YouTube</button> </div>
);
}
export default App;
how to remove react icon from tab
<link rel="shortcut icon" href="/a.png" /> which should be not present by the way or try deleting the favicon
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us