score:1

Accepted answer
const [currentRoom, setCurrentRoom] = useState()
const [room] = useState([
  { label: "Depression", value: "Depression" },
  { label: "Anxiety", value: "Anxiety" },
  { label: "Chat", value: "Chat" },
]);

return (
  <select
    className="joinInput mt-20"
    onChange={(event) => setCurrentRoom(event.currentTarget.value)}
    value={currentRoom}
    >
    <option value="">Select value...</option>
    {room.map((rooms) => (
      <option key={rooms.value} value={rooms.value}>
        {rooms.label}
      </option>
    ))}
  </select>
);

Related Query

More Query from same tag