Created
February 20, 2018 17:06
-
-
Save jordanfarrer/500c5e08fdcda5978b04bd991d7c892e to your computer and use it in GitHub Desktop.
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 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