Skip to main content

Custom _document

If you need to update the document's head, you can do so by updating the _document Head theme property, this property takes in a component.

caution

The Head component used in _document is not the same as next/head. The <Head /> component used here should only be used for any <head> code that is common for all pages. For all other cases, such as <title> tags, we recommend using next/head in your pages or components.

import createTheme from '@orgnc/core/lib/themes/createTheme';
import HeadComponent from 'path/to/HeadComponent';

const theme = createTheme({
//...
_document_: {
Head: HeadComponent,
},
//...
});

export default theme;