UNPKG

sharyn

Version:

Combines all the other packages under one.

17 lines (12 loc) 341 B
// @flow /* eslint-disable import/no-extraneous-dependencies */ import React from 'react' const renderIf = (propCheck: Function, AltCmp?: Function) => (BaseCmp: Function) => ( props: Object, ) => { if (propCheck(props)) { return AltCmp ? <AltCmp {...props} /> : null } return <BaseCmp {...props} /> } export default renderIf