slides.com/joekarlsson | @joekarlsson1
http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html
2015
Math.random()
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>;
}
};
class Item extends Component {
shouldComponentUpdate(nextProps, nextState) {
if (this.props.title !== nextProps.title) {
return true;
}
return false;
}
render() {
return <h3>{ this.props.title }</h3>
}
};
class Item extends PureComponent {
render() {
return <h3>{ this.props.title }</h3>
}
};
NODE_ENV = 'production'
Please fill out this feedback form:
https://goo.gl/forms/Hsn6oonjyIl1yxCm1