fix: Inc button disabled state, color threshold, dead code, and minor cleanup#1
Open
q121212 wants to merge 1 commit into
Open
fix: Inc button disabled state, color threshold, dead code, and minor cleanup#1q121212 wants to merge 1 commit into
q121212 wants to merge 1 commit into
Conversation
…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)
|
@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. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 4 bugs in the counter app:
Inc button never disabled - Dec button uses disabled={count === 0} but Inc button had no disabled attribute. Added disabled={count === 10}.
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.
Dead code in handleDec - unreachable else branch since Dec button disabled at count=0. Removed.
Minor: removed redundant count >= 0 check, removed unnecessary React import, fixed capitalization.