Skip to content

Instantly share code, notes, and snippets.

@Kosmin
Last active March 7, 2017 23:29
Show Gist options
  • Save Kosmin/3606a1b38f9703053567f2d239e1c6da to your computer and use it in GitHub Desktop.
Save Kosmin/3606a1b38f9703053567f2d239e1c6da to your computer and use it in GitHub Desktop.
React Pure Component with Immutable Props Example
import React, { PropTypes, PureComponent } from 'react';
class Car extends PureComponent {
render() {
return (
<div>
{`Your object: ${details.name} ${details.color}`}
</div>
);
}
}
export default Car;
/*
E.g:
<Car details={Immutable.fromJS({ name: 'BMW', color: 'black' })} />
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment