I need help with a coding snippet
interface IProps {
isEdit: boolean;
menuOpenId: number | boolean
}
function useMenuForm({ isEdit, menuOpenId }: IProps){...}
Any suggestions on how to set menuOpenId
as type number
when isEdit
is true
, otherwise keep it as a boolean?