mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
0dd2b2aa74
* Add warning for undefined url and as coming from popstate * Use consistent url * Fix err.sh link in test * Rename `inital` => `initial`
678 B
678 B
getInitialProps was defined as an instance method
Why This Error Occurred
getInitialProps
must be a static method in order to be called by next.js.
Possible Ways to Fix It
Use the static keyword.
export default class YourEntryComponent extends React.Component {
static getInitialProps () {
return {}
}
render () {
return 'foo'
}
}
or
const YourEntryComponent = function () {
return 'foo'
}
YourEntryComponent.getInitialProps = () => {
return {}
}
export default YourEntryComponent