Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import React from 'react';
import PropTypes from 'prop-types';
import {Grid} from 'pivotal-ui/react/flex-grids';
import classnames from 'classnames';
export class FormRow extends React.Component {
static propTypes = {
state: PropTypes.object,
children: PropTypes.node,
className: PropTypes.string,
id: PropTypes.string,
wrapper: PropTypes.func
};
render() {
const {state, children, className, id, wrapper} = this.props;
const row = (<Grid {...{id, className: classnames(className, 'form-row')}}>{children}</Grid>);
return wrapper ? React.cloneElement(wrapper(state), {children: row}) : row;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.