getInitialProps
must be a static method in order to be called by next.js.
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