File tree 3 files changed +3
-20
lines changed
demos/default/pages/getStaticProps
3 files changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ const Show = ({ show }) => (
20
20
export async function getStaticProps ( context ) {
21
21
const res = await fetch ( `https://api.tvmaze.com/shows/71` )
22
22
const data = await res . json ( )
23
- console . log ( data )
24
23
25
24
return {
26
25
props : {
Original file line number Diff line number Diff line change 1
1
import Link from 'next/link'
2
2
3
- const Show = ( { show } ) => (
3
+ const Show = ( ) => (
4
4
< 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 >
15
6
16
7
< Link href = "/" >
17
8
< a > Go back home</ a >
@@ -20,14 +11,8 @@ const Show = ({ show }) => (
20
11
)
21
12
22
13
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
-
27
14
return {
28
- props : {
29
- show : data ,
30
- } ,
15
+ props : { } ,
31
16
notFound : new Date ( ) . getMinutes ( ) % 10 < 5 ,
32
17
revalidate : 60 ,
33
18
}
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ const Show = ({ show }) => (
20
20
export async function getStaticProps ( context ) {
21
21
const res = await fetch ( `https://api.tvmaze.com/shows/71` )
22
22
const data = await res . json ( )
23
- console . log ( data )
24
23
25
24
return {
26
25
props : {
You can’t perform that action at this time.
0 commit comments