File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
examples/with-nextjs/pages Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Async from "react-async"
3
3
import DevTools from "react-async-devtools"
4
4
import fetch from "isomorphic-fetch"
5
5
import Link from "next/link"
6
+ import { withRouter } from "next/router"
6
7
7
8
const loadUser = ( { userId = 1 } ) =>
8
9
fetch ( `https://reqres.in/api/users/${ userId } ` )
@@ -17,8 +18,8 @@ class Hello extends React.Component {
17
18
}
18
19
19
20
render ( ) {
20
- const { data, url } = this . props
21
- const { userId = 1 } = url . query
21
+ const { data, router } = this . props
22
+ const { userId = 1 } = router . query
22
23
return (
23
24
< >
24
25
{ process . browser && < DevTools /> }
@@ -62,4 +63,4 @@ class Hello extends React.Component {
62
63
}
63
64
}
64
65
65
- export default Hello
66
+ export default withRouter ( Hello )
You can’t perform that action at this time.
0 commit comments