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. 31
      README.md

31
README.md

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

Loading…
Cancel
Save