From da7b7ca2a0c8bb2e0063b668f5d6f6ce999ddde9 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 25 Dec 2015 14:30:28 +0800 Subject: [PATCH] fix: Form should support `className` #711 --- components/form/Form.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/form/Form.jsx b/components/form/Form.jsx index 0236bc4546..56e1e4cffe 100644 --- a/components/form/Form.jsx +++ b/components/form/Form.jsx @@ -3,15 +3,15 @@ import classNames from 'classnames'; class Form extends React.Component { render() { - const prefixCls = this.props.prefixCls; - const formClassName = { + const { prefixCls, className } = this.props; + const formClassName = classNames({ + [className]: !!className, [`${prefixCls}-horizontal`]: this.props.horizontal, [`${prefixCls}-inline`]: this.props.inline, - }; - const classes = classNames(formClassName); + }); return ( -
+ {this.props.children}
);