Browse Source

Merge pull request #635 from cauburtin/patch-4

few errors thrown by react0.14
pull/650/head
Lebedev Konstantin 9 years ago
parent
commit
338400eb6a
  1. 23
      README.md

23
README.md

@ -386,14 +386,14 @@ var SortableList = React.createClass({
render: function() {
return <ul>{
this.state.items.map(function (text) {
return <li>{text}</li>
this.state.items.map(function (text, i) {
return <li ref={i}>{text}</li>
})
}</ul>
}
});
React.render(<SortableList />, document.body);
ReactDOM.render(<SortableList />, document.body);
//
@ -409,17 +409,18 @@ var AllUsers = React.createClass({
},
getInitialState: function() {
return { users: ['Abbi', 'Adela', 'Bud', 'Cate', 'Davis', 'Eric']; };
return { users: ['Abbi', 'Adela', 'Bud', 'Cate', 'Davis', 'Eric'] };
},
render: function() {
return (
return (<div>
<h1>Users</h1>
<ul ref="user">{
this.state.users.map(function (text) {
return <li>{text}</li>
this.state.users.map(function (text, i) {
return <li ref={i}>{text}</li>
})
}</ul>
</div>
);
}
});
@ -429,19 +430,19 @@ var ApprovedUsers = React.createClass({
sortableOptions: { group: "shared" },
getInitialState: function() {
return { items: ['Hal', 'Judy']; };
return { items: ['Hal', 'Judy'] };
},
render: function() {
return <ul>{
this.state.items.map(function (text) {
return <li>{text}</li>
this.state.items.map(function (text, i) {
return <li ref={i}>{text}</li>
})
}</ul>
}
});
React.render(<div>
ReactDOM.render(<div>
<AllUsers/>
<hr/>
<ApprovedUsers/>

Loading…
Cancel
Save