Skip to content

Instantly share code, notes, and snippets.

@cellog
Created January 14, 2017 07:51
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 cellog/89bc5e37c1f1a01a6a2a0a3c9693eee0 to your computer and use it in GitHub Desktop.
Save cellog/89bc5e37c1f1a01a6a2a0a3c9693eee0 to your computer and use it in GitHub Desktop.
conditional rendering based on data
import Camper from './Camper'
export default ({ year, ...otherData }) => {
return (
<div>
{ otherData.year === year ? <Camper {...otherData} /> : null }
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment