Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use items
directly.
problem
控制台报错 Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use items
directly.
reason
https://ant.design/components/tabs/
Usage upgrade after 4.23.0#文章来源:https://www.toymoban.com/news/detail-633620.html
antd tabs组件 在 4.23.0 版本上做了更新文章来源地址https://www.toymoban.com/news/detail-633620.html
solution
// before
<Tabs activeKey={type} onChange={setType}>
<Tabs.TabPane key="account" tab={'账户密码登录'} />
<Tabs.TabPane key="mobile" tab={'手机号登录'} />
</Tabs>
// after
const items = [
{ label: '账户密码登录', key: 'account', },
{ label: '手机号登录', key: 'mobile', },
];
<Tabs activeKey={type} onChange={setType} items={items}></Tabs>
到了这里,关于Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use `items` directly.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!