Untitled conversation
- User
{player.social?.instagram && ( <a href={
https://instagram.com/${player.social.instagram}} target="_blank" rel="noopener noreferrer"> )} Actually I'm returning everything about instagram from player.social.instagram- url so I don't before url but when I'm removing it, it is getting me to localhost:3000/api/player/player.social.instagram - Assistant
It looks like you're trying to create a link to a player's Instagram profile using the
player.social.instagramproperty. When you remove or incorrectly format the URL, the link might default to localhost or another fallback route. Let's break down the issue and resolve it. - User
{player.social?.instagram && ( This is the statement http://localhost:3000/players/www.instagram.com/vardy7?hl=it This is, where it is taking me
- Assistant
The issue you're experiencing is that the
hrefattribute is directly using the value ofplayer.social.instagram, expecting it to be a full URL, but it's not. Instead, it likely contains either just the username or a partial URL, causing it to concatenate with your site's current location when clicked.If
player.social.instagramcontains a value likewww.instagram.com/vardy7, it appears to be incorrectly formatted as trying to redirect you within your local site as a relative URL. Let's correct that.Steps to Fix:
-
Ensure is Only the Username:
-