Skip to content

Instantly share code, notes, and snippets.

@amitsingh-007
Created July 11, 2021 07:38
Show Gist options
  • Save amitsingh-007/23d7f76859ef5acdb96e7b2608ca09eb to your computer and use it in GitHub Desktop.
Save amitsingh-007/23d7f76859ef5acdb96e7b2608ca09eb to your computer and use it in GitHub Desktop.
Add reference to manifest file
import React, { memo } from "react";
import Helmet from "react-helmet";
/* This should load on every page so that no matter on which page the user lands,
* we fetch the manifest.json file
*/
export const GlobalMetaTags = memo(() => (
<Helmet
titleAttributes={{ itemprop: "name" }}
htmlAttributes={{
itemscope: "",
itemtype: "http://schema.org/WebPage",
}}
>
<link rel="manifest" href="/manifest.webmanifest.json" />
<meta name="theme-color" content="#E53012">
</Helmet>
));
GlobalMetaTags.displayName = "GlobalMetaTags";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment