The objective is to create a select element that maps out all the names as drop downs with react hooks, for some reason it's only rendering the first element and getting undefined errors, any code references can be provided
import React from 'react';
import styles from './style.css'
const Traveler = () => {
const travelers = [
{ title: "What kind of traveler are you?", name: [
"Adrenaline Addicts", "Culture Lovers", "Aquatic adventures", "Beach enthusiasts", "Adventure seekers",
"Party hoppers", "Motor fans"
] }
]
return (
<React.Fragment>
<select type="text" name="Transportation" className={styles.select}>
<option value="Transportation" className={styles.field} value={travelers[0].title}></option>
{ travelers.map((item, index) => {
return(
<option>{item[0].name[index]}</option>
);
})
}
</select>
</React.Fragment>
);
}
export default Traveler;
````
hooks anywhere