Skip to content

Instantly share code, notes, and snippets.

@OlivierJM
Last active August 22, 2018 11:03
Show Gist options
  • Save OlivierJM/4004f7606056f53c7a659031bd2767ff to your computer and use it in GitHub Desktop.
Save OlivierJM/4004f7606056f53c7a659031bd2767ff to your computer and use it in GitHub Desktop.
// 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