Skip to content

Commit

Permalink
fix: prevent empty inputs for game difficulty
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobTheEldest committed May 27, 2023
1 parent 2217a66 commit 18a5c4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const App: React.FC = () => {
name="columns"
className="columns"
onChange={handleColumnsChange}
value={cols}
value={cols ? cols : 0}
/>

<span className="rows">Rows:</span>
Expand All @@ -115,7 +115,7 @@ const App: React.FC = () => {
name="rows"
className="rows"
onChange={handleRowsChange}
value={rows}
value={rows ? rows : 0}
/>

<span className="mines">Mines:</span>
Expand All @@ -124,7 +124,7 @@ const App: React.FC = () => {
name="mines"
className="mines-input"
onChange={handleMinesChange}
value={mines}
value={mines ? mines : 0}
/>

<button type="submit">New Game</button>
Expand Down

0 comments on commit 18a5c4d

Please sign in to comment.