Skip to content

Instantly share code, notes, and snippets.

@jordanfarrer
Created February 20, 2018 17:06
Show Gist options
  • Save jordanfarrer/500c5e08fdcda5978b04bd991d7c892e to your computer and use it in GitHub Desktop.
Save jordanfarrer/500c5e08fdcda5978b04bd991d7c892e to your computer and use it in GitHub Desktop.
import PropTypes from 'prop-types';
const Experiment = ({ isInTestGroup, renderA, renderB }) => {
if (isInTestGroup) {
return renderB();
}
return renderA();
};
Experiment.propTypes = {
isInTestGroup: PropTypes.bool.isRequired,
renderA: PropTypes.func.isRequired,
renderB: PropTypes.func.isRequired,
};
export default Experiment;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment