@findify/react-components
Version:
Findify react UI components
12 lines (11 loc) • 334 B
JSX
/**
* @module components/common/Branch
*/
import { Fragment } from 'react';
const Branch = ({ left, right, children, condition, ...props }) => {
const Component = (condition
? left
: right || Fragment);
return <Component {...((condition || right) && props)}>{children}</Component>;
};
export default Branch;