Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kosmin/7ad03a9b81811a9b488b314af386be8d to your computer and use it in GitHub Desktop.
Save Kosmin/7ad03a9b81811a9b488b314af386be8d to your computer and use it in GitHub Desktop.
React Regular Component With Pure Render Example
import React, { PropTypes, Component } from 'react';
class Car extends Component {
shouldComponentUpdate(nextProps) {
return this.props.details.name === nextProps.details.name &&
this.props.details.color === nextProps.details.color;
}
render() {
return (
<div>
{`Your object: ${details.name} ${details.color}`}
</div>
);
}
}
export default Car;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment