Ionic6 react menucontroller is not working

Hi all,
I’m trying to toggle ionic menu in both desktop and mobile. But in desktop I’m not able to close the menu. I tried varies methods. Even menucontroller is not Preformatted textworking.
here is my code

<IonMenuButton auto-hide="false" menu="mymenu" onClick={() => openMenu("mymenu")} />

import { menuController } from "@ionic/core/components";

function openMenu(menu: string) {

I tried IonMenuToggle as Well but also not working.

Can anyone help me with this?