refactor: remove defaultProps from <Collapse /> and move logic to destruction, as rest of props for single source of truth (#27963)

This commit is contained in:
Eugene Matvejev 2020-11-24 12:06:41 +00:00 committed by GitHub
parent 0ca5e686d9
commit 41a6c655bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ interface CollapseInterface extends React.FC<CollapseProps> {
const Collapse: CollapseInterface = props => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className = '', bordered, ghost } = props;
const { prefixCls: customizePrefixCls, className = '', bordered = true, ghost } = props;
const prefixCls = getPrefixCls('collapse', customizePrefixCls);
const getIconPosition = () => {
@ -83,6 +83,7 @@ const Collapse: CollapseInterface = props => {
<RcCollapse
openAnimation={openAnimation}
{...props}
bordered={bordered}
expandIcon={(panelProps: PanelProps) => renderExpandIcon(panelProps)}
prefixCls={prefixCls}
className={collapseClassName}
@ -92,8 +93,4 @@ const Collapse: CollapseInterface = props => {
Collapse.Panel = CollapsePanel;
Collapse.defaultProps = {
bordered: true,
};
export default Collapse;