Adding favicon to in React
up vote
3
down vote
favorite
I was trying to add a favicon in the <Helmet/>
tag of a React App
my current <Helmet/>
tag looks like this.
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
links={
rel='icon',
type='image/png',
sizes='16x16',
href={require('favicon.ico')}
}
/>
But I'm getting an error about an unexpected token, any inputs on how to add a favicon? Thanks for the help in advance.
reactjs favicon react-helmet
add a comment |
up vote
3
down vote
favorite
I was trying to add a favicon in the <Helmet/>
tag of a React App
my current <Helmet/>
tag looks like this.
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
links={
rel='icon',
type='image/png',
sizes='16x16',
href={require('favicon.ico')}
}
/>
But I'm getting an error about an unexpected token, any inputs on how to add a favicon? Thanks for the help in advance.
reactjs favicon react-helmet
Just fyi: when you open braces in jsx you're back to writing js, and the value insidelinks={...}
isn't valid js.
– Alex Guerra
Apr 6 at 22:44
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I was trying to add a favicon in the <Helmet/>
tag of a React App
my current <Helmet/>
tag looks like this.
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
links={
rel='icon',
type='image/png',
sizes='16x16',
href={require('favicon.ico')}
}
/>
But I'm getting an error about an unexpected token, any inputs on how to add a favicon? Thanks for the help in advance.
reactjs favicon react-helmet
I was trying to add a favicon in the <Helmet/>
tag of a React App
my current <Helmet/>
tag looks like this.
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
links={
rel='icon',
type='image/png',
sizes='16x16',
href={require('favicon.ico')}
}
/>
But I'm getting an error about an unexpected token, any inputs on how to add a favicon? Thanks for the help in advance.
reactjs favicon react-helmet
reactjs favicon react-helmet
asked Apr 6 at 22:34
UWGOOSE
67211
67211
Just fyi: when you open braces in jsx you're back to writing js, and the value insidelinks={...}
isn't valid js.
– Alex Guerra
Apr 6 at 22:44
add a comment |
Just fyi: when you open braces in jsx you're back to writing js, and the value insidelinks={...}
isn't valid js.
– Alex Guerra
Apr 6 at 22:44
Just fyi: when you open braces in jsx you're back to writing js, and the value inside
links={...}
isn't valid js.– Alex Guerra
Apr 6 at 22:44
Just fyi: when you open braces in jsx you're back to writing js, and the value inside
links={...}
isn't valid js.– Alex Guerra
Apr 6 at 22:44
add a comment |
2 Answers
2
active
oldest
votes
up vote
3
down vote
If you are using react-helmet in your project then I think one issue with your code is that link should be singular, not the plural 'links'
Try this
import Helmet from 'react-helmet'
...
<Helmet>
<title>ABC</title>
<meta name="ABC" content: "ABC" />
<link rel="icon" type="image/png" href="favicon.ico" sizes="16x16" />
</Helmet>
add a comment |
up vote
0
down vote
Try this please. You written wrong keyword(links => link)
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
link={[
{"rel": "icon",
"type": "image/png",
"href": "favicon.ico"
}
]}
/>
New contributor
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
If you are using react-helmet in your project then I think one issue with your code is that link should be singular, not the plural 'links'
Try this
import Helmet from 'react-helmet'
...
<Helmet>
<title>ABC</title>
<meta name="ABC" content: "ABC" />
<link rel="icon" type="image/png" href="favicon.ico" sizes="16x16" />
</Helmet>
add a comment |
up vote
3
down vote
If you are using react-helmet in your project then I think one issue with your code is that link should be singular, not the plural 'links'
Try this
import Helmet from 'react-helmet'
...
<Helmet>
<title>ABC</title>
<meta name="ABC" content: "ABC" />
<link rel="icon" type="image/png" href="favicon.ico" sizes="16x16" />
</Helmet>
add a comment |
up vote
3
down vote
up vote
3
down vote
If you are using react-helmet in your project then I think one issue with your code is that link should be singular, not the plural 'links'
Try this
import Helmet from 'react-helmet'
...
<Helmet>
<title>ABC</title>
<meta name="ABC" content: "ABC" />
<link rel="icon" type="image/png" href="favicon.ico" sizes="16x16" />
</Helmet>
If you are using react-helmet in your project then I think one issue with your code is that link should be singular, not the plural 'links'
Try this
import Helmet from 'react-helmet'
...
<Helmet>
<title>ABC</title>
<meta name="ABC" content: "ABC" />
<link rel="icon" type="image/png" href="favicon.ico" sizes="16x16" />
</Helmet>
answered Apr 6 at 23:04
Lucas Kellner
1114
1114
add a comment |
add a comment |
up vote
0
down vote
Try this please. You written wrong keyword(links => link)
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
link={[
{"rel": "icon",
"type": "image/png",
"href": "favicon.ico"
}
]}
/>
New contributor
add a comment |
up vote
0
down vote
Try this please. You written wrong keyword(links => link)
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
link={[
{"rel": "icon",
"type": "image/png",
"href": "favicon.ico"
}
]}
/>
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
Try this please. You written wrong keyword(links => link)
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
link={[
{"rel": "icon",
"type": "image/png",
"href": "favicon.ico"
}
]}
/>
New contributor
Try this please. You written wrong keyword(links => link)
<Helmet
title="ABC"
meta={[
{ name: "ABC", content: "ABC" }
]}
link={[
{"rel": "icon",
"type": "image/png",
"href": "favicon.ico"
}
]}
/>
New contributor
New contributor
answered 19 hours ago
sekercan cepni
1
1
New contributor
New contributor
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49701856%2fadding-favicon-to-helmet-in-react%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Just fyi: when you open braces in jsx you're back to writing js, and the value inside
links={...}
isn't valid js.– Alex Guerra
Apr 6 at 22:44