Commit 8578038d authored by Remy Sharp's avatar Remy Sharp Committed by Tim Neutkens

Change _error.js example to use `err` prop (#3197)

The `jsonPageRes` isn't always there, whereas `err` is, and when used,
provides a consistent statusCode in the client when compared to the
server.
parent 741f2113
......@@ -849,10 +849,8 @@ __Note: React-components outside of `<Main />` will not be initialised by the br
import React from 'react'
export default class Error extends React.Component {
static getInitialProps({ res, jsonPageRes }) {
const statusCode = res
? res.statusCode
: jsonPageRes ? jsonPageRes.status : null
static getInitialProps({ res, err }) {
const statusCode = res ? res.statusCode : err ? err.statusCode : null;
return { statusCode }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment