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"
33import DevTools from "react-async-devtools"
44import fetch from "isomorphic-fetch"
55import Link from "next/link"
6+ import { withRouter } from "next/router"
67
78const loadUser = ( { userId = 1 } ) =>
89 fetch ( `https://reqres.in/api/users/${ userId } ` )
@@ -17,8 +18,8 @@ class Hello extends React.Component {
1718 }
1819
1920 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
2223 return (
2324 < >
2425 { process . browser && < DevTools /> }
@@ -62,4 +63,4 @@ class Hello extends React.Component {
6263 }
6364}
6465
65- export default Hello
66+ export default withRouter ( Hello )
You can’t perform that action at this time.
0 commit comments