Skip to content

Instantly share code, notes, and snippets.

@thawkin3
Created February 22, 2021 17:00
Show Gist options
  • Save thawkin3/d7e61939998ec48635688f4cad309a87 to your computer and use it in GitHub Desktop.
Save thawkin3/d7e61939998ec48635688f4cad309a87 to your computer and use it in GitHub Desktop.
3. Boolean props - Bad Example
import React from 'react'
const HungryMessage = ({ isHungry }) => (
<span>{isHungry ? 'I am hungry' : 'I am full'}</span>
)
export const BooleanPropBad = () => (
<div>
<span>
<b>This person is hungry: </b>
</span>
<HungryMessage isHungry={true} />
<br />
<span>
<b>This person is full: </b>
</span>
<HungryMessage isHungry={false} />
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment