Skip to content

Commit b6d5e6b

Browse files
committed
fix: remove api call from new revalidate page
1 parent 51c4cd3 commit b6d5e6b

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

demos/default/pages/getStaticProps/static.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const Show = ({ show }) => (
2020
export async function getStaticProps(context) {
2121
const res = await fetch(`https://api.tvmaze.com/shows/71`)
2222
const data = await res.json()
23-
console.log(data)
2423

2524
return {
2625
props: {

demos/default/pages/getStaticProps/with-revalidate-404.js

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
import Link from 'next/link'
22

3-
const Show = ({ show }) => (
3+
const Show = () => (
44
<div>
5-
<p>
6-
This page uses getStaticProps() to pre-fetch a TV show, but will return a 404 if the current time ends in 0-4.
7-
</p>
8-
9-
<hr />
10-
11-
<h1>Show #{show.id}</h1>
12-
<p>{show.name}</p>
13-
14-
<hr />
5+
<p>This page is ISR, but will return a 404 if the current time ends in 0-4.</p>
156

167
<Link href="/">
178
<a>Go back home</a>
@@ -20,14 +11,8 @@ const Show = ({ show }) => (
2011
)
2112

2213
export async function getStaticProps(context) {
23-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
24-
const data = await res.json()
25-
console.log(data)
26-
2714
return {
28-
props: {
29-
show: data,
30-
},
15+
props: {},
3116
notFound: new Date().getMinutes() % 10 < 5,
3217
revalidate: 60,
3318
}

demos/default/pages/getStaticProps/with-revalidate.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const Show = ({ show }) => (
2020
export async function getStaticProps(context) {
2121
const res = await fetch(`https://api.tvmaze.com/shows/71`)
2222
const data = await res.json()
23-
console.log(data)
2423

2524
return {
2625
props: {

0 commit comments

Comments
 (0)