diff --git a/examples/real-world/components/Repo.js b/examples/real-world/components/Repo.js index b9bb4fa8b0..06e0605e38 100644 --- a/examples/real-world/components/Repo.js +++ b/examples/real-world/components/Repo.js @@ -1,16 +1,7 @@ -import React, { PropTypes } from 'react'; +import React, { Component, PropTypes } from 'react'; import { Link } from 'react-router'; -export default class Repo { - static propTypes = { - repo: PropTypes.shape({ - name: PropTypes.string.isRequired, - description: PropTypes.string - }).isRequired, - owner: PropTypes.shape({ - login: PropTypes.string.isRequired - }).isRequired - } +export default class Repo extends Component { render() { const { repo, owner } = this.props; @@ -35,3 +26,13 @@ export default class Repo { ); } } + +Repo.propTypes = { + repo: PropTypes.shape({ + name: PropTypes.string.isRequired, + description: PropTypes.string + }).isRequired, + owner: PropTypes.shape({ + login: PropTypes.string.isRequired + }).isRequired +}; diff --git a/examples/real-world/middleware/api.js b/examples/real-world/middleware/api.js index 1b898d45e8..fd3a9f24f6 100644 --- a/examples/real-world/middleware/api.js +++ b/examples/real-world/middleware/api.js @@ -41,10 +41,11 @@ function callApi(endpoint, schema) { const camelizedJson = camelizeKeys(json); const nextPageUrl = getNextPageUrl(response) || undefined; - return { - ...normalize(camelizedJson, schema), + return Object.assign({ + {}, + normalize(camelizedJson, schema), nextPageUrl - }; + }); }); }