From 98b48fb3ec0b2edece70b21fe89de005a6c0f375 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 c53082fd3c..f6b2ad04a8 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 } } -- GitLab