So basically, I am working on a project I am not so experienced with REACT, I want to make a simple dropdown that will change the Url (simple).
Here is the code-
function Front() {
const [selectedOption, setSelectedOption] = React.useState("A");
if (selectedOption === "A") {
//Do something here (but what so that I can put that value of selectedOption in the Url?)
} else if (selectedOption === "B") {
//Do something here
} else if (selectedOption === "C"){
//Do somthing here
}
return (
<>
<div className ="front__text">
<h1>Wind Pioneers</h1> <button>Tutorial</button>
</div>
<div className="front__text__second">
<p>Select System</p>
<select className="drop" value={selectedOption}
onChange={evt => setSelectedOption(evt.target.value)}>
<option value="A" id={1} >1
</option>
<option value="B" id={2}>
2
</option>
<option value="C" id={3}>
3
</option>
</select>
</div>
</div>
</>
)
}
I tried to use but I think Link and anchor tags not works there as this might consider as bad HTML. What should I need to do to get out of this, plus I don't even want to use any external library to do this.