Created
February 22, 2021 17:00
-
-
Save thawkin3/d7e61939998ec48635688f4cad309a87 to your computer and use it in GitHub Desktop.
3. Boolean props - Bad Example
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
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