I have the following 'Button' component:
<Button
variant="contained"
label="START"
color="secondary"
size="large"
onClick={handleClick}
/>
Which when pressed opens the following Confirm dialogue box:
<Confirm
isOpen={open}
title="Update View Count"
content="Are you sure you want to update these posts?"
onConfirm={handleConfirm}
onClose={handleDialogClose}
/>
Once confirmed, I would like to open a URL on a new tab. I am currently using the redirect() function to open it, however it opens it on the same tab. I know I can use target="_blank" in the 'Button' component but that opens the URL before the confirmation.
const redirect = useRedirect();
const handleClick = () => setOpen(true);
const handleDialogClose = () => setOpen(false);
const handleConfirm = () => {
redirect("www.google.com");
setOpen(false);
};