feat(_document): add extension element

This commit is contained in:
Aminejv 2021-08-25 14:46:23 +01:00
parent e05aba7f51
commit 9ed780f1db

25
pages/_document.js Normal file
View File

@ -0,0 +1,25 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}
render() {
return (
<Html>
<Head />
<body>
{/** NOTE(amine): used to communicate with the extension via classNames.
* e.g. if the extension is installed on the user's browser, it will add 'isDownloaded' to className*/}
<div id="chrome_extension" />
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;