Skip to content

Commit 889a7be

Browse files
committed
Merge pull request #466 from danmartinez101/use-es6-in-real-world-example
Update real world example to remove ES7
2 parents 6446dfd + 8b5298c commit 889a7be

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

examples/real-world/components/Repo.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
import React, { PropTypes } from 'react';
1+
import React, { Component, PropTypes } from 'react';
22
import { Link } from 'react-router';
33

4-
export default class Repo {
5-
static propTypes = {
6-
repo: PropTypes.shape({
7-
name: PropTypes.string.isRequired,
8-
description: PropTypes.string
9-
}).isRequired,
10-
owner: PropTypes.shape({
11-
login: PropTypes.string.isRequired
12-
}).isRequired
13-
}
4+
export default class Repo extends Component {
145

156
render() {
167
const { repo, owner } = this.props;
@@ -35,3 +26,13 @@ export default class Repo {
3526
);
3627
}
3728
}
29+
30+
Repo.propTypes = {
31+
repo: PropTypes.shape({
32+
name: PropTypes.string.isRequired,
33+
description: PropTypes.string
34+
}).isRequired,
35+
owner: PropTypes.shape({
36+
login: PropTypes.string.isRequired
37+
}).isRequired
38+
};

examples/real-world/middleware/api.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ function callApi(endpoint, schema) {
4141
const camelizedJson = camelizeKeys(json);
4242
const nextPageUrl = getNextPageUrl(response) || undefined;
4343

44-
return {
45-
...normalize(camelizedJson, schema),
44+
return Object.assign({
45+
{},
46+
normalize(camelizedJson, schema),
4647
nextPageUrl
47-
};
48+
});
4849
});
4950
}
5051

0 commit comments

Comments
 (0)