Skip to content

Instantly share code, notes, and snippets.

@smeijer
Created August 2, 2019 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smeijer/90ca271fb82165da217808171a6d5c5c to your computer and use it in GitHub Desktop.
Save smeijer/90ca271fb82165da217808171a6d5c5c to your computer and use it in GitHub Desktop.
medium-costs-of-optional-chaining-3
function CommentButtons({ user }) {
const can = user ? user.can : {};
return (
<div>
<Button disabled={can.edit}>edit</Button>
<Button disabled={can.delete}>delete</Button>
<Button disabled={can.reply}>reply</Button>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment