fix(WorkList): fix invalid prop className of type boolean supplied to Button#5921
Open
Shenkeeee wants to merge 2 commits into
Open
fix(WorkList): fix invalid prop className of type boolean supplied to Button#5921Shenkeeee wants to merge 2 commits into
className of type boolean supplied to Button#5921Shenkeeee wants to merge 2 commits into
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Context
The problem
As soon as you open up the app, this warning comes up in the console, while seeing WorkList:
"Warning: Failed prop type: Invalid prop
classNameof typebooleansupplied toButton, expectedstring"The cause and fix
boolean && stringifbooleanisfalse, causesfalseto be passed.Updated the line to have the same functionality that was intended while getting rid of the warning.
Changes & Results
Update WorkList.tsx
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
Fixes the PropTypes warning caused by
!isValidMode && 'bg-[#222d44]'evaluating to the booleanfalsewhen the mode is valid, by replacing it with a ternary that always yields a string ('bg-[#222d44]'or''). TheButtoncomponent declaresclassName: PropTypes.string, so this makes the prop usage correctly typed with no behavior change.Confidence Score: 5/5
Safe to merge — the fix is minimal, correct, and eliminates a real PropTypes warning without changing runtime behavior.
Single-line change that correctly converts a boolean short-circuit expression to a ternary, satisfying the Button's PropTypes.string constraint. No logic changes, no side effects, no other files touched.
No files require special attention.
Important Files Changed
boolean && stringpattern with a ternary to ensureclassNamealways receives astringinstead offalse.Reviews (2): Last reviewed commit: "Merge branch 'master' into master" | Re-trigger Greptile