Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kgravenreuth/b2e7f4797fb1964ee835361a8d8d21e6 to your computer and use it in GitHub Desktop.
Save kgravenreuth/b2e7f4797fb1964ee835361a8d8d21e6 to your computer and use it in GitHub Desktop.
Cloudbet Odds Comparison Sports Dropdown
//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