-
-
Save imdongchen/46ad6f4fdfab449bbd33931b0f1336ff to your computer and use it in GitHub Desktop.
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
function Profile(props) { | |
const { name, age } = props | |
return ( | |
<div> | |
<h2>{name}</h2> | |
<div>{age}</div> | |
<Detail {...props} /> | |
</div> | |
) | |
} | |
// usage, say, connect to redux | |
const ConnectedProfile = connect(state => ({ | |
name: state.name, | |
age: state.age, | |
gender: state.gender, // this prop appears not necessary | |
})(Profile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this work better?