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

更新到3.20.0后,Drawer 抽屉报错 #17387

Closed
1 task
XianZhengquan opened this issue Jul 1, 2019 · 21 comments · Fixed by #17390
Closed
1 task

更新到3.20.0后,Drawer 抽屉报错 #17387

XianZhengquan opened this issue Jul 1, 2019 · 21 comments · Fixed by #17390
Assignees

Comments

@XianZhengquan
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

打开抽屉,控制台报错
image

What is expected?

不报错

What is actually happening?

报错

Environment Info
antd 3.20.0
React 16.8.6
System windows10
Browser chrome74
@afc163
Copy link
Member

afc163 commented Jul 1, 2019

same as react-component/drawer#109

@hengkx
Copy link
Member

hengkx commented Jul 1, 2019

https://github.com/react-component/drawer/blob/master/src/Drawer.js#L500

这个地方是不是 直接过滤掉组件内部所需要的属性,或者 直接移除

@jljsj33
Copy link
Member

jljsj33 commented Jul 1, 2019

renderEmpty 和 getPrefixClass 不是 drawer 的 props, 干啥用的??必需要加在 drawer 上吗?

@wuchaoya
Copy link

wuchaoya commented Jul 2, 2019

ant-design-pro 升级到v4,使用ts版,也会有这个错误,我看官网预览并没有这个错误,然后我对比了yarn create umi创建的package.json中antd版本和ant-design-pro v4分支中antd版本,发现一个为3.20.0,另一个是3.16.1,我试图安装3.16.1版,结果这个现象就没了

@XianZhengquan
Copy link
Contributor Author

@wuchaoya 是antd 这次更新后(3.20.0)之后才出现的问题

@XianZhengquan
Copy link
Contributor Author

现在我的项目 只要用到 Drawer 就是一片红

@XianZhengquan
Copy link
Contributor Author

image
image
image
image
image

@jljsj33
Copy link
Member

jljsj33 commented Jul 2, 2019

pr 已经发了,等待解决方案,这种警告其实也没什么大问题,只是在开发环境会出现这样的。

@bytemain
Copy link
Member

bytemain commented Jul 3, 2019

这次更新后,Drawer好像会一直挂载在页面上了。之前每次开 Drawer 都会重新挂载组件


更新:destroyOnClose 这个方法

@OwenMelbz
Copy link

What is the current fix for this?

Thanks :)

@bytemain
Copy link
Member

bytemain commented Jul 4, 2019

What is the current fix for this?

Thanks :)

#17390

@sunclelee
Copy link

我也遇到这种情况了,折腾了半天也没解决

@larants
Copy link

larants commented Jul 4, 2019

在3.20出现改问题,期待官网早日解决

@sanriqing
Copy link

附议

@seondizon
Copy link

ff

@nuintun
Copy link
Contributor

nuintun commented Jul 8, 2019

@jljsj33 希望能在 Drawer 中过滤到非 Drawer 的属性,现在封装高阶组件又想保留 Drawer 原有 props 写法太蛋痛 - -!

render() {
  const {
    mask,
    title,
    width,
    style,
    zIndex,
    filter,
    height,
    layout,
    loading,
    onClose,
    visible,
    closable,
    children,
    onSubmit,
    onChange,
    keyboard,
    onInvalid,
    className,
    autoReset,
    placement,
    maskStyle,
    bodyStyle,
    maskClosable,
    getContainer,
    destroyOnClose,
    onVisibleChange,
    hideRequiredMark,
    afterVisibleChange,
    ...restProps
  } = this.props;
  const { submitting } = this.state;
  const spinProps = this.getSpinProps(loading);

  return (
    <Drawer
      mask={mask}
      title={title}
      style={style}
      width={width}
      height={height}
      zIndex={zIndex}
      visible={visible}
      closable={closable}
      keyboard={keyboard}
      placement={placement}
      maskStyle={maskStyle}
      bodyStyle={bodyStyle}
      onClose={this.handleClose}
      getContainer={getContainer}
      maskClosable={maskClosable}
      onChange={this.handleChange}
      destroyOnClose={destroyOnClose}
      afterVisibleChange={afterVisibleChange}
      className={classNames(styles.formDrawer, className)}
    >
      <Form className={styles.form} onSubmit={this.handleSubmit} layout={layout} hideRequiredMark={hideRequiredMark}>
        <Spin {...spinProps} wrapperClassName={classNames(styles.spinning, spinProps.wrapperClassName)}>
          <div ref={this.body} className={styles.body}>
            <ConfigProvider getPopupContainer={this.getPopupContainer}>
              {this.renderChildren(children, restProps)}
            </ConfigProvider>
          </div>
        </Spin>
        <div className={styles.footer}>
          <Button disabled={spinProps.spinning} onClick={this.handleClose}>
            取消
          </Button>
          <Button disabled={spinProps.spinning} type="primary" loading={submitting && { delay: 150 }} htmlType="submit">
            确定
          </Button>
        </div>
      </Form>
    </Drawer>
  );
}

@jljsj33
Copy link
Member

jljsj33 commented Jul 8, 2019

@nuintun 可以 pr...

@se7en00
Copy link

se7en00 commented Jul 30, 2019

ERROR in ./node_modules/rc-dialog/es/DialogWrap.js
Module not found: Error: Can't resolve 'rc-util/es/PortalWrapper' in 'E:\workSpace\RobotAdmin\node_modules\rc-dialog
 @ ./node_modules/rc-dialog/es/DialogWrap.js 4:0-46 24:31-37
 @ ./node_modules/antd/lib/modal/Modal.js
 @ ./node_modules/antd/lib/modal/index.js
 @ ./src/views/AdviceRobot/AdviceModal.tsx
 @ ./src/views/AdviceRobot/workFlow/WorkFlowTree.tsx
 @ ./src/views/AdviceRobot/AdviceKeywordDetails.tsx
 @ ./src/menus/menu.ts
 @ ./src/layout/PrimaryLayout.tsx
 @ ./src/containers/App/index.tsx
 @ ./src/index.tsx
 @ multi ./src/index.tsx

ERROR in ./node_modules/rc-drawer/es/DrawerWrapper.js
Module not found: Error: Can't resolve 'rc-util/es/PortalWrapper' in 'E:\workSpace\RobotAdmin\node_modules\rc-drawer
 @ ./node_modules/rc-drawer/es/DrawerWrapper.js 23:0-46 121:33-39
 @ ./node_modules/rc-drawer/es/index.js
 @ ./node_modules/antd/lib/drawer/index.js
 @ ./src/views/orgDrawer/index.tsx
 @ ./src/views/AdviceRobot/AdviceForm.tsx
 @ ./src/views/AdviceRobot/AdviceKeywordDetails.tsx
 @ ./src/menus/menu.ts
 @ ./src/layout/PrimaryLayout.tsx
 @ ./src/containers/App/index.tsx
 @ ./src/index.tsx
 @ multi ./src/index.tsx

ERROR in ./node_modules/rc-dialog/es/Dialog.js
Module not found: Error: Can't resolve 'rc-util/es/switchScrollingEffect' in 'E:\workSpace\RobotAdmin\node_modules\r
alog\es'
 @ ./node_modules/rc-dialog/es/Dialog.js 9:0-69 189:12-33 200:12-33
 @ ./node_modules/rc-dialog/es/DialogWrap.js
 @ ./node_modules/antd/lib/modal/Modal.js
 @ ./node_modules/antd/lib/modal/index.js
 @ ./src/views/AdviceRobot/AdviceModal.tsx

我这边也是,ts下 更新到最新版本3,20.6, 直接报错了

@zombieJ
Copy link
Member

zombieJ commented Jul 30, 2019

@se7en00,
更新一下 node_module,应该是有依赖 ood 了。

@se7en00
Copy link

se7en00 commented Jul 30, 2019

@zombieJ
删除了, 重新yarn 还是一样, 依赖找不到。
返回3.19.8 就没有这个问题

@jljsj33
Copy link
Member

jljsj33 commented Jul 30, 2019

把 xxxxx.lock 删了试试?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.