Skip to content

Commit

Permalink
fix: wrap fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjoeio committed May 30, 2020
1 parent b77bc1d commit 5eaa65b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ const Hero = () => {
const theme = useTheme()
const date = new Date()

fetch('/.netlify/functions/hello')
.then(response => response.json())
.then(console.log)
if (typeof window !== 'undefined') {
fetch('/.netlify/functions/hello')
.then(response => response.json())
.then(console.log)
}

return (
<section
Expand Down

0 comments on commit 5eaa65b

Please sign in to comment.