|
|
|
@ -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 ( |
|
|
|
|
<h1>Users</h1> |
|
|
|
|
<ul ref="user">{ |
|
|
|
|
this.state.users.map(function (text) { |
|
|
|
|
return <li>{text}</li> |
|
|
|
|
}) |
|
|
|
|
}</ul> |
|
|
|
|
return (<div> |
|
|
|
|
<h1>Users</h1> |
|
|
|
|
<ul ref="user">{ |
|
|
|
|
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/> |
|
|
|
|