react-planner-viewer
Version:
react-planner-viewer is a React Component for view plans builded with react-planner in 2D mode
15 lines (12 loc) • 344 B
JSX
import React from 'react';
import PropTypes from 'prop-types';
/**
* @return {null}
*/
export default function If({condition, style, children}) {
return condition ? ( Array.isArray(children) ? <div style={style}>{children}</div> : children ) : null;
}
If.propTypes = {
condition: PropTypes.bool.isRequired,
style: PropTypes.object
};