Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm drawer config consumer props #17390

Merged
merged 2 commits into from Jul 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions components/drawer/index.tsx
Expand Up @@ -219,6 +219,14 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
title,
push,
onClose,
visible,
// ConfigConsumerProps
getPopupContainer,
rootPrefixCls,
getPrefixCls,
renderEmpty,
csp,
autoInsertSpaceInButton,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样以后 ConfigProvider 加东西还会出现,@zombieJ 看看有没有更好的办法。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我一般用到什么加什么,rest 会有点多……

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样以后加个属性,又会有一堆报错。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以抽一个库处理 dom attr,传递给 dom 前 omit 掉不用的。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能否 withConfigConsumer 加个参数,声明组件用到的 props,这样后续 ConfigProvider 加属性不会影响到已有组件。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类似于 originProps 这种吗?

...rest
} = this.props;
warning(
Expand Down