Skip to content

fix: Inc button disabled state, color threshold, dead code, and minor cleanup#1

Open
q121212 wants to merge 1 commit into
jdcodebase:mainfrom
q121212:fix/bugs-1-to-4
Open

fix: Inc button disabled state, color threshold, dead code, and minor cleanup#1
q121212 wants to merge 1 commit into
jdcodebase:mainfrom
q121212:fix/bugs-1-to-4

Conversation

@q121212

@q121212 q121212 commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Fixes 4 bugs in the counter app:

  1. Inc button never disabled - Dec button uses disabled={count === 0} but Inc button had no disabled attribute. Added disabled={count === 10}.

  2. Valid values displayed as errors - color threshold count >= 0 && count <= 6 turned values 7, 8, 9 red. Fixed to only show red at count >= 10.

  3. Dead code in handleDec - unreachable else branch since Dec button disabled at count=0. Removed.

  4. Minor: removed redundant count >= 0 check, removed unnecessary React import, fixed capitalization.

…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)
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

@q121212 is attempting to deploy a commit to the Jatin Dhamija's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant