Last active
March 7, 2017 23:29
-
-
Save Kosmin/3606a1b38f9703053567f2d239e1c6da to your computer and use it in GitHub Desktop.
React Pure Component with Immutable Props Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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