File tree 2 files changed +4
-6
lines changed
examples/data-fetch/pages
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import Link from 'next/link'
3
- import 'isomorphic-unfetch'
3
+ import fetch from 'isomorphic-unfetch'
4
4
5
5
export default class Index extends React . Component {
6
6
static async getInitialProps ( ) {
7
- // eslint-disable-next-line no-undef
8
7
const res = await fetch ( 'https://api.github.com/repos/zeit/next.js' )
9
8
const json = await res . json ( )
10
9
return { stars : json . stargazers_count }
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import Link from 'next/link'
3
- import 'isomorphic-unfetch'
3
+ import fetch from 'isomorphic-unfetch'
4
4
5
5
export default class Preact extends React . Component {
6
6
static async getInitialProps ( ) {
7
- // eslint-disable-next-line no-undef
8
7
const res = await fetch ( 'https://api.github.com/repos/developit/preact' )
9
8
const json = await res . json ( )
10
9
return { stars : json . stargazers_count }
@@ -13,9 +12,9 @@ export default class Preact extends React.Component {
13
12
render ( ) {
14
13
return (
15
14
< div >
16
- < p > Preact has { this . props . stars } ⭝ </ p >
15
+ < p > Preact has { this . props . stars } ⭐ </ p >
17
16
< Link href = '/' >
18
- < a > I bet next has more stars (?)</ a >
17
+ < a > I bet Next.js has more stars (?)</ a >
19
18
</ Link >
20
19
</ div >
21
20
)
You can’t perform that action at this time.
0 commit comments