Usage with Portal
To render the Menu
at a specific place in the DOM. You can use react portal for that.
import { createPortal } from 'react-dom';
import { MyMenu } from "./somwhere";
function Portal({children}){
return createPortal(children, document.querySelector("#my-node"));
}
function MyApp(){
return (
<main>
<Portal>
<MyMenu />
</Portal>
</main>
)
}