Skip to content

Commit 59f6884

Browse files
committed
onRenderBody must be exported with export const
1 parent ab7a855 commit 59f6884

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

gatsby-ssr.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
const React = require(`react`)
2-
const { URL } = require(`url`)
3-
4-
console.log('ON FILE LOAD')
1+
import React from 'react'
2+
import { URL } from 'url'
53

64
function getLinkProps({ crossOrigin, pathname }) {
75
switch (typeof crossOrigin) {
@@ -14,7 +12,7 @@ function getLinkProps({ crossOrigin, pathname }) {
1412
}
1513
}
1614

17-
exports.onRenderBody = (
15+
export const onRenderBody = (
1816
{ setHeadComponents, pathname = `/` },
1917
{ crossOrigin = `anonymous` } = {}
2018
) => {
@@ -40,7 +38,6 @@ exports.onRenderBody = (
4038
} catch (e) {
4139
assetProps = { crossOrigin: `anonymous` }
4240
}
43-
console.log('props', assetProps)
4441

4542
return (
4643
<link key={href} as="font" href={href} rel="preload" {...assetProps} />

0 commit comments

Comments
 (0)