Contenu connexe
Similaire à AtlasCamp 2015: How HipChat ships at the speed of awesome (20)
AtlasCamp 2015: How HipChat ships at the speed of awesome
- 1. how HipChat ships at the
speed of awesome
ISSAC GERGES • SENIOR DEVELOPER • HIPCHAT • @GERGES
- 10. React
var Link = require(‘./link');
module.exports = React.createClass({
displayName: "RightSideBarLinks",
render: function(){
return (
<div>
_.map(this.props.links, (link) => {
return <Link key={link.id} name={link.user_name} url={link.url}
users={this.props.users} time={link.time} display_url={link.display_url}/>;
});
</div>
);
}
});
// Easy to define a reusable component
// JSX for easy to read component markup
- 11. return <Link key={link.id} name={link.user_name} url={link.url}
users={this.props.users} time={link.time} display_url={link.display_url}/>;
return (
<div>
);
</div>
React + JSX
_.map(this.props.links, (link) => {
});
- 12. );
return (
React.createElement(Link, {
key: link.id,
name: link.user_name,
url: link.url,
users: this.props.users,
time: link.time,
display_url: link.display_url
});
<div>
</div>
React + JSX
_.map(this.props.links, (link) => {
});
- 13. );
React.createElement("div", {},
React.createElement(Link, {
key: link.id,
name: link.user_name,
url: link.url,
users: this.props.users,
time: link.time,
display_url: link.display_url
});
);
return (
React + JSX
_.map(this.props.links, (link) => {
});
// Every render returns an object
// Easy to tell if anything’s changed and React can apply a delta to the DOM
- 38. How HipChat Ships at the Speed of Awesome
Submit your feedback:
go.atlassian.com/acawesome