I am developing a Nextjs app and would want to direct user to another link using router.push
but I do not know how to open the link in new tab.
My code is like this right now:
import { useRouter } from "next/navigation";
const router = useRouter();
<Button
onClick={() => {
router.push(`${mylink}`);
}}
>
Order
</Button>
Router.push is meant to be used to continue on the same tab to upload new content to that page. Try using window.open('www.yourdomain.com', '_blank');
instead.