Last active
August 22, 2018 11:03
-
-
Save OlivierJM/4004f7606056f53c7a659031bd2767ff to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// functional component with partial destructuring | |
const UserSection = ({ user, isActive }) => ( | |
<div> | |
<p>{user.name}</p> <span> {isActive ? 'active' : 'offline'} </span> | |
</div> | |
); | |
// functional component with no destructuring | |
const UserSection = props => ( | |
<div> | |
<p>{props.user.name}</p> <span> {props.isActive ? 'active' : 'offline'} </span> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment