Created
January 5, 2022 06:01
-
-
Save kgravenreuth/b2e7f4797fb1964ee835361a8d8d21e6 to your computer and use it in GitHub Desktop.
Cloudbet Odds Comparison Sports Dropdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//App.js | |
import "./styles.css"; | |
import React from "react"; | |
const sports = ["soccer", "basketball", "american-football"]; | |
export default function App() { | |
const [apiKey, setApiKey] = React.useState(""); | |
const [sport, setSport] = React.useState(sports[0]); | |
return ( | |
<div className="App"> | |
<div> | |
<label for="sport">Sport</label> | |
<select value={sport} onChange={(e) => setSport(e.target.value)}> | |
{sports.map((s) => ( | |
<option value={s}>{s}</option> | |
))} | |
</select> | |
</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment