Joe Karlsson
progress. tech. cats. coffee. art. food. photog. mpls.
slides.com/joekarlsson | @joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
2015
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
Math.random()
@joekarlsson1
class List extends Component {
render() {
const itemNode = this.props.posts.map((item, idx) => {
return <Item post={ item } key={ Math.random() } />;
})
return <div>{ itemNode }</div>;
}
};
class List extends Component {
render() {
const itemNode = this.props.posts.map((item, idx) => {
return <Item post={ item } key={ idx } />;
})
return <div>{ itemNode }</div>;
}
};
@joekarlsson1
@joekarlsson1
@joekarlsson1
class Item extends Component {
shouldComponentUpdate(nextProps, nextState) {
if (this.props.title !== nextProps.title) {
return true;
}
return false;
}
render() {
return <h3>{ this.props.title }</h3>
}
};
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
class Item extends PureComponent {
render() {
return <h3>{ this.props.title }</h3>
}
};
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
NODE_ENV = 'production'
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
@joekarlsson1
By Joe Karlsson
React is built with performance in mind. But when is React slow? In this talk we’ll discuss common bottlenecks in React and when you might be making your program work harder than it should.