fix modal not support configProvider (#17132)

This commit is contained in:
zombieJ 2019-06-17 12:47:31 +08:00 committed by GitHub
parent dc1572cff1
commit b4025176d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,13 +190,17 @@ export default class Modal extends React.Component<ModalProps, {}> {
);
};
renderModal = ({ getPrefixCls }: ConfigConsumerProps) => {
renderModal = ({
getPopupContainer: getContextPopupContainer,
getPrefixCls,
}: ConfigConsumerProps) => {
const {
prefixCls: customizePrefixCls,
footer,
visible,
wrapClassName,
centered,
getContainer,
...restProps
} = this.props;
@ -216,6 +220,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
return (
<Dialog
{...restProps}
getContainer={getContainer || getContextPopupContainer}
prefixCls={prefixCls}
wrapClassName={classNames({ [`${prefixCls}-centered`]: !!centered }, wrapClassName)}
footer={footer === undefined ? defaultFooter : footer}