Ant-design-pro: 新项目git后运行报警告LocaleProvider is deprecated.

Created on 5 Aug 2019  ·  31Comments  ·  Source: ant-design/ant-design-pro

Warning: [antd: LocaleProvider]LocaleProvideris deprecated. Please uselocalewithConfigProviderinstead: http://u.ant.design/locale

语言选用的是js

搜索了一下,好像用到LocaleProvider的地方只有src/pages/.umi/LocaleWrapper.jsx,官方建议是.umi文件下不能修改,那这个应该怎么解决呢?

⛱ wait

Most helpful comment

此外,除了这个错误还有一堆这个warning
“react-dom.development.js:11495 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: ConnectedRouter, Route, Router, Switch”

点击侧边栏的时候:报这个“ Warning: pro-layout: onCollapse and collapsed should exist simultaneously” @chenshuai2144 (语言选的 typescript)

All 31 comments

这是个 warning ,你可以暂时忽略,会在 umi-locale 中做修改

这是个 warning ,你可以暂时忽略,会在 umi-locale 中做修改

是你们改,还是自己改?

记录位置,接收更新通知

此外,除了这个错误还有一堆这个warning
“react-dom.development.js:11495 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: ConnectedRouter, Route, Router, Switch”

点击侧边栏的时候:报这个“ Warning: pro-layout: onCollapse and collapsed should exist simultaneously” @chenshuai2144 (语言选的 typescript)

@LuzMariaa 这个是因为官方不推荐使用 componentWillMount

同时也需要兼容 3.21.0 之前的版本

遇到了同样的问题,好像官方还是没修复好

请问好了吗,我umi更新到了最新版,还是不行,还有那一堆componentWillMount has been renamed的警告。

umi 发个新版就 ok 了。

@ycjcl868 您好,我清理后重新install,然后使用 umi dev 启动,还是同样的警告,lock文件中我看umi依赖已经是最新版了

umi@^2.8.7:
  version "2.8.18"
[email protected]:
  version "2.9.11"

补充一下:我是之前用yarn create umi 创建的antd pro项目,install是用的yarn

相同的问题clone的最新版项目启动时1个error6个warning
图片

umi 为2.8.18版本:

图片

同样的问题,请尽快修复吧,不然开发真的很不方便啊

locale 问题已修复,升级到 2.8.19

有些组件使用了将废弃的 react api,@chenshuai2144 cc

@ycjcl868 不是我们的,是第三方的,16 的时候我们已经清理过了。
社区需要反应一段时间

marked

Fixed in lastest umi version.

Fixed in lastest umi version.

今天使用了umi 2.8.20 还是有这一堆警告哎。。我看了看了2.8.20是最后一个版本啊
image

react 的警告

react生命周期即将废弃的警告

所以现在最新版本更新了就好了是吗

试一下 不就行了 説是解决了

umi 2.9.3 版本warning依然存在

升级下 ant-design 呢

升级下 ant-design 呢

antd: 3.23.1
umi: 2.9.3

依然存在

LocaleProvider 的解决了,其它⚠️警告处理需要一步步来修掉。 https://github.com/umijs/umi/pull/2993

antd组件的报错,可以通过指定react和react-dom版本来解决,

"react": "16.8.6",
"react-dom": "16.8.6",

等antd4上线再改成可变版本吧

这种warning问题解决了吗????

Screenshot from 2019-10-23 08-42-03

哪个版本解决了?我也是一堆告警

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ·  3Comments

zhuanglong picture zhuanglong  ·  3Comments

happier2 picture happier2  ·  3Comments

yjz1004 picture yjz1004  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments