From 60a9193e543f87ed1ab1a6600fefa62f500df17f Mon Sep 17 00:00:00 2001 From: Max Rekunchak Date: Sat, 11 Jul 2026 12:51:20 +0300 Subject: [PATCH] fix: add Inc button disabled state, fix color threshold, remove dead code - Add disabled={count === 10} to Inc button for consistency with Dec button - Fix color threshold from count > 6 to count >= 10 (valid values 7-9 no longer show as errors) - Remove unreachable handleDec else branch (button disabled at count=0) - Remove redundant count >= 0 condition in color check - Remove unnecessary React import (new JSX transform) --- src/App.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index ecfe0ca..10cd48d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import "./App.css"; const App = () => { @@ -10,15 +10,13 @@ const App = () => { setError(""); setCount((prevCount) => prevCount + 1); } else { - setError("Value Cannot be greater than 10"); + setError("Value cannot be greater than 10"); } }; const handleDec = () => { if (count > 0) { setError(""); setCount((prevCount) => prevCount - 1); - } else { - setError("Value Cannot be less than 0"); } }; const handleReset = () => { @@ -33,7 +31,7 @@ const App = () => { Count :{" "} = 0 && count <= 6 ? "#000" : "red", + color: count >= 10 ? "red" : "#000", }} > {" "} @@ -43,7 +41,7 @@ const App = () => { {error &&

{error}

}
-