当前位置:网站首页>Warning: [antd: Menu] `children` will be removed in next major version. Please use `items` instead.
Warning: [antd: Menu] `children` will be removed in next major version. Please use `items` instead.
2022-06-30 15:45:00 【Forget the noise】
Warning: [antd: Menu] children will be removed in next major version. Please use items instead.

andt The update resulted in a warning https://ant.design/components/menu-cn/
stay 4.20.0 After version , We provide
Project original Writing
const MenuList = [
{
key: '/Home',
label: ' home page '
},
{
key: '/MobxExplain',
label: 'mobx Case study '
},
{
key: '/HOCExplain',
label: ' High order component '
}
]
class MenuView extends react.PureComponent {
// generate menu
MapMenuList = () => {
const mapMenuNode = MenuList.map(({
label, key, to }) => {
return (
<Menu.Item key={
key}>
<Link to={
to}>{
label}</Link>
</Menu.Item>
)
})
return mapMenuNode
}
render() {
return (
<Menu
defaultSelectedKeys={
['1']}
defaultOpenKeys={
['sub1']}
mode="inline"
theme="dark"
// inlineCollapsed={false}
>
{
this.MapMenuList()}
</Menu>
)
}
}
The updated writing looks like this
const MenuView = (props) => {
const {
history } = props
const onClick = (MenuItem) => {
history.push(MenuItem.key)
}
return (
<Menu
defaultSelectedKeys={
['1']}
defaultOpenKeys={
['sub1']}
mode="inline"
theme="dark"
items={
MenuList}
onClick={
onClick} // Click submenu to trigger
// inlineCollapsed={false}
>
</Menu>
)
}
边栏推荐
- RTC monthly tabloid programming challenge ended successfully in June; Review of the first anniversary of sound network's listing
- Using asp Net core creating web API series
- ADB devices cannot detect the problem of Xiaomi note 3
- Policy Center > Device and Network Abuse
- Pointer understanding
- 分布式机器学习:模型平均MA与弹性平均EASGD(PySpark)
- Teach you a learning method to quickly master knowledge
- Generating verification code with sring
- Mysql事务/锁/日志总结
- [sub matrix quantity statistics] cf1181c flag sub matrix quantity statistics
猜你喜欢

How to browse mobile web pages on your computer

NPM install --global --save --save dev differences
![[sub matrix quantity statistics] cf1181c flag sub matrix quantity statistics](/img/91/2a94749d64d153ef1caf81345594a4.png)
[sub matrix quantity statistics] cf1181c flag sub matrix quantity statistics

Lecun points out the direction of next generation AI: autonomous machine intelligence

Super comprehensive redis distributed high availability solution: sentry mechanism

Talk about why I started technical writing

爬虫(1) - 爬虫基础入门理论篇

Technology sharing | how to quickly realize audio and video online calls

Imeta | Ye Mao / Shi Yu reviewed the dynamic shuttle and ecological function of intracellular and extracellular genes in the environmental microbiome

iMeta | 叶茂/时玉等综述环境微生物组中胞内与胞外基因的动态穿梭与生态功能...
随机推荐
4.7 type() function query data type
Asp.NetCore利用缓存使用AOP方式防止重复提交
Curl: (23) failed writing body (1354 i= 1371) problem solving method
String common API
Guada digital analog
Anyrtc implements application scenarios based on webrtc
Technology sharing | how to quickly realize audio and video online calls
linux下修改mysql密码: ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
4.8 data type conversion
C language foundation - pointer array - initialization method & constant pointer array, pointer constant array
Preliminary study on AI noise reduction evaluation system of sound network
Chapter III installation and use of jupyter
国债逆回购在哪个平台上买比较安全?
String connector
4.2 escape characters
Openresty built in variable
Flask Sqlalchemy - how to use custom query criteria ---orm (7)
爬虫(1) - 爬虫基础入门理论篇
Fundamentals of C language -- similarities and differences between arrays and pointers
Specific steps for installing mysql8.0 on Windows system