I have an Ant button set up like this:
<Button
style={{ borderRadius: '0.5rem' }}
type="default"
target="_blank"
onClick={() => {
window.location.assign(
value.upComing[0].jitsiUrl,
);
}}
>
Join your Jitsi appointment
</Button>
where value.upComing[0].jitsiUrl is a URL string. However, when I actually press on the button, it appends the URL to the end of the current path, like this:
Additionally, it does not open in a new tab. Thus, I would like to know how to make it so that when the button is pressed, the URL is successfully opened in a new tab. I have tried using the "href" attribute with the "target = '_blank' " attribute, and while this opens in a new tab, the URL still appends to the end of the current path. (And for some reason, the string is undefined when I try that).
(Note: the App uses React and NextJS)
It's been a few days since I solved this, so sorry for the late update. It turns out, I had to append my URL with "https://", as it wasn't saved like that in the database. After that, it worked.