0

So i have a React application I'm working on and i want to link the github repo to each mapped out card via props. props is fine for all other array values. but for some reason my URL to an external link isn't working. It doesn't even console a value. the IMG URL works and display absolutely fine.

here's a sample from array:

[
   {
        name: "Giphy Searcher",
        subTitle: "Front-End React Project",
        imgURL: "https://i.ibb.co/MkgZ5rj/Screen-Shot-2022-08-10-at-7-52-01-AM.png",
        info: "Search application resulting from Giphy API",
        info2: "secondary info paragraph form",
        githubLink: "http://www.github.com",
        liveSite: "http://www.deployment.com"
    }
]

and here is a tag inside the card:

function Cards(props) {
    return (
        <div className="cardHolder">
            <a target='_blank' href={props.githubLink}>
            <Card className="card">
                <Card.Img src={props.imgURL} />
                <Card.Body>
                    <Card.Title className="cardText">{props.name}</Card.Title>
                    <Card.Text className="cardText">{props.subTitle}</Card.Text>
                    <Card.Text className="cardText">{props.info}</Card.Text>
                    <Card.Text id="gameInfo"> {props.infoTwo} </Card.Text>
                </Card.Body>
            </Card>
            </a>
        </div>
    )
}
vimuth
  • 5,064
  • 33
  • 79
  • 116
  • What's your Card component look like? – ddastrodd Aug 10 '22 at 17:52
  • Also, take a look at this post: https://stackoverflow.com/questions/28893855/how-to-use-normal-anchor-links-with-react-router – ddastrodd Aug 10 '22 at 17:54
  • 1
    From the code given there's nothing to suggest what's going wrong, so the problem must not be in the code given. The first thing I would check is to log the keys that `props` actually contains (as opposed to what you expect it to contain). – Daniel Beck Aug 10 '22 at 17:56
  • omg im an idiot. its not there to pass. function createCard(gamesData) { return ( – PatriotxZero Aug 10 '22 at 17:57
  • sorry this is the first big prop project ive ever done on my own. ill take a look at the post and see if i can learn more too. thanks! – PatriotxZero Aug 10 '22 at 17:57

0 Answers0