Skip to content

{object} is an object but has no label key error #261

Answered by janosh
igorlanko asked this question in Q&A
Discussion options

You must be logged in to vote

Yep, that's the recommend solution. The value key is optional and defaults to label if missing. So you could do

$: allTags = data.allTags.map((tag) => ({ label: tag.title }))

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@janosh
Comment options

Answer selected by janosh
@igorlanko
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