Skip to content

Commit 86655d7

Browse files
committed
Merge pull request #618 from mrienstra/master
Examples: Minor code changes to address warnings.
2 parents 4e96256 + 8260a36 commit 86655d7

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

examples/async-data/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ var App = React.createClass({
6262
},
6363

6464
renderContacts () {
65-
return this.props.data.contacts.map((contact) => {
65+
return this.props.data.contacts.map((contact, i) => {
6666
return (
67-
<li>
67+
<li key={i}>
6868
<Link to="contact" params={contact}>{contact.first} {contact.last}</Link>
6969
</li>
7070
);

examples/data-flow/app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ var App = React.createClass({
3232
},
3333

3434
render: function () {
35-
var links = this.state.tacos.map(function (taco) {
36-
return <li><Link to="taco" params={taco}>{taco.name}</Link></li>;
35+
var links = this.state.tacos.map(function (taco, i) {
36+
return (
37+
<li key={i}>
38+
<Link to="taco" params={taco}>{taco.name}</Link>
39+
</li>
40+
);
3741
});
3842
return (
3943
<div className="App">

examples/partial-app-loading/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ var AsyncElement = {
2020
},
2121

2222
render: function () {
23-
var component = this.constructor.loadedComponent;
24-
if (component) {
23+
var Component = this.constructor.loadedComponent;
24+
if (Component) {
2525
// can't find RouteHandler in the loaded component, so we just grab
2626
// it here first.
2727
this.props.activeRoute = <RouteHandler/>;
28-
return component(this.props);
28+
return <Component {...this.props}/>;
2929
}
3030
return this.preRender();
3131
}

0 commit comments

Comments
 (0)