Skip to content

Instantly share code, notes, and snippets.

@JoeTheDave
Created June 29, 2016 17:44
Show Gist options
  • Save JoeTheDave/5d78f9aae295b2f19c8c3f96c0d0ec75 to your computer and use it in GitHub Desktop.
Save JoeTheDave/5d78f9aae295b2f19c8c3f96c0d0ec75 to your computer and use it in GitHub Desktop.
import React from 'react';
const ExampleComponent = ({show}) => {
const componentClasses = ['example-component'];
if (show) { componentClasses.push('show'); }
return (
<div className={componentClasses.join(' ')}></div>
);
};
ExampleComponent.propTypes = {
show: React.PropTypes.bool.isRequired
};
export default ExampleComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment