mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
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:
parent
0ca5e686d9
commit
41a6c655bf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user