From 8578038daaa2545edb9fd767a7cd660e7779122c Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Sat, 28 Oct 2017 08:23:15 +0100 Subject: [PATCH] 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. --- readme.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index c53082fd..f6b2ad04 100644 --- a/readme.md +++ b/readme.md @@ -849,10 +849,8 @@ __Note: React-components outside of `
` 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 } }