Skip to content

Image does not display? #508

Answered by fergcb
Seiyaroo asked this question in Q&A
Jul 9, 2024 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

Ah, I see what the issue is. The image URL is just the path of the image, and doesn't include the domain, so you also need to add in the base URL of the API:

{monster.image && <img src={'https://www.dnd5eapi.co' + monster.image} alt={`An image of a ${monster.name}`} />}

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Seiyaroo
Comment options

@fergcb
Comment options

@Seiyaroo
Comment options

@fergcb
Comment options

Answer selected by Seiyaroo
@Seiyaroo
Comment options

@fergcb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants