import React, { useState } from 'react'
const ANIMALS = ['Dog', 'Cat', 'Lion', 'Elephant'];
export const Example = ()=>{
const [animal, setAnimal] = useState("");
return (
<div>
<form>
<label htmlFor="animal">
Animal:
<select
id="animal"
value={animal}
onChange={(e)=>{setAnimal(e.target.value)}}
>
<option>Select Option ... </option>
{ANIMALS.map((animal)=>(
<option key={animal}>{animal}</option>
))
}
</select>
</label>
</form>
</div>
)
}