import React, { useEffect, useState } from 'react'; import { Menu, Switch } from 'antd'; export interface SwitchMenuItemProps { onChange?: any; title?: any; checked?: boolean; } export function SwitchMenuItem(props: SwitchMenuItemProps) { const { onChange } = props; const [checked, setChecked] = useState(props.checked); useEffect(() => { setChecked(props.checked); }, [props.checked]); return (