首页 > 其他分享 >react18-学习笔记48-基础架构-menuItem.tsx

react18-学习笔记48-基础架构-menuItem.tsx

时间:2023-02-12 11:33:03浏览次数:42  
标签:React const 48 disabled className 基础架构 react18 MenuItem children


import React from "react"

import classNames from 'classnames'

export interface MenuItemProps {
index?: string;
disabled?: boolean;
className?: string;
style?: React.CSSProperties;
children?:any
}

const MenuItem: React.FC<MenuItemProps> = (props) => {
const { index, disabled, className, style, children } = props

const classes = classNames('menu-item', className, {
'is-disabled': disabled
})

return (
<li className={classes} style={style}>
{children}
</li>
)
}

MenuItem.displayName = 'MenuItem'
export default MenuItem

标签:React,const,48,disabled,className,基础架构,react18,MenuItem,children
From: https://blog.51cto.com/u_15460007/6052013

相关文章