From cd0a1767f473cae61c02c524303b8f20dfca5243 Mon Sep 17 00:00:00 2001 From: Erik Nguyen Date: Tue, 18 Dec 2018 16:45:36 +0800 Subject: [PATCH] change errorCode prop name for clearer explanation of code example (#5914) --- packages/next/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/next/README.md b/packages/next/README.md index 3a83f79921..d28ef38b55 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -1196,15 +1196,15 @@ import fetch from 'isomorphic-unfetch' export default class Page extends React.Component { static async getInitialProps() { const res = await fetch('https://api.github.com/repos/zeit/next.js') - const statusCode = res.statusCode > 200 ? res.statusCode : false + const errorCode = res.statusCode > 200 ? res.statusCode : false const json = await res.json() - return { statusCode, stars: json.stargazers_count } + return { errorCode, stars: json.stargazers_count } } render() { - if (this.props.statusCode) { - return + if (this.props.errorCode) { + return } return ( -- GitLab