ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.31k stars 1.36k forks source link

Cannot read property '_currentValue' of undefined 部署环境报错 #593

Closed skyunBoss closed 4 years ago

skyunBoss commented 4 years ago

🧐 问题描述

使用protable的页面都会报错:Cannot read property '_currentValue' of undefined

💻 示例代码

import ProTable from '@ant-design/pro-table';

<ProTable actionRef={this.tableRef} options={false} toolBarRender={() => [ <Button type="primary" onClick={() => history.push('/system/freightTemplate/add')}

新建 , ]} rowKey="id" columns={columns} request={({ current, ...params }) => this.fetchListData({ page: current, ...params }) } pagination={{ showSizeChanger: true, }} />

🚑 其他信息

"@ant-design/icons": "^4.0.0", "@ant-design/pro-layout": "^6.0.0", "@ant-design/pro-table": "^2.4.4", "antd": "^4.4.0", "axios": "^0.19.2", "braft-editor": "^2.3.9", "classnames": "^2.2.6", "js-cookie": "^2.2.1", "js-md5": "^0.7.3", "lodash": "^4.17.11", "moment": "^2.25.3", "nprogress": "^0.2.0", "numeral": "^2.0.6", "omit.js": "^1.0.2", "path-to-regexp": "2.4.0", "qs": "^6.9.4", "react": "^16.8.6", "react-dom": "^16.8.6", "react-helmet-async": "^1.0.4", "umi": "^3.2.18", "umi-request": "^1.0.8", "use-merge-value": "^1.0.1"

skyunBoss commented 4 years ago

umi 版本 和 protable 版本相差大导致报错

zhourusheng commented 3 years ago

umi 版本 和 protable 版本相差大导致报错

遇到同样的问题,请问最后怎么解决的? @skyunBoss

chenshuai2144 commented 3 years ago

更新一下依赖,antd umi 和 pro-table

kkaaddff commented 3 years ago

pro-table 新的版本用到了antd的 ConfigProvider.ConfigContext 这个在antd中注释了 /* @private internal usage. do not use in your production / ConfigProvider.ConfigContext = ConfigContext; export default ConfigProvider;

暂时在项目中添加了 import { ConfigProvider } from 'antd' import { ConfigContext } from 'antd/es/config-provider' // @ts-ignore ConfigProvider.ConfigContext = ConfigContext

已经解决上述问题

ps.因为项目比较大,项目中antd和umi无法再升级,所以采用了折中方案,如果可以升级的项目还是升级到最新的版本

revanli commented 3 years ago

pro-table 新的版本用到了antd的 ConfigProvider.ConfigContext 这个在antd中注释了 /* @Private internal usage. do not use in your production / ConfigProvider.ConfigContext = ConfigContext; export default ConfigProvider;

暂时在项目中添加了 import { ConfigProvider } from 'antd' import { ConfigContext } from 'antd/es/config-provider' // @ts-ignore ConfigProvider.ConfigContext = ConfigContext

已经解决上述问题

ps.因为项目比较大,项目中antd和umi无法再升级,所以采用了折中方案,如果可以升级的项目还是升级到最新的版本

尝试过升级没能解决,@kkaaddff 这个方案有效果,谢谢

CorgiTT commented 1 month ago

pro-table 新的版本用到了antd的 ConfigProvider.ConfigContext 这个在antd中注释了 /* @Private internal usage. do not use in your production / ConfigProvider.ConfigContext = ConfigContext; export default ConfigProvider;

暂时在项目中添加了 import { ConfigProvider } from 'antd' import { ConfigContext } from 'antd/es/config-provider' // @ts-ignore ConfigProvider.ConfigContext = ConfigContext

已经解决上述问题

ps.因为项目比较大,项目中antd和umi无法再升级,所以采用了折中方案,如果可以升级的项目还是升级到最新的版本

这么严重的问题,为什么不提到一级版本号更新,antd能不能严谨点