0👍
✅
genreOptions
is an object with key/value, you could use Object.entries
then map
to get the expected output :
const genreOptions = Object.entries({
"Horror": "Korku",
"Comedy": "Komedi\u0103 Filmi",
"Action": "Aksiyon",
"Drama": "Drama"
}).map(
([type, label])=>({
value: type,
label: label
})
)
Source:stackexchange.com