Skip to content

fix(WorkList): fix invalid prop className of type boolean supplied to Button#5921

Open
Shenkeeee wants to merge 2 commits into
OHIF:masterfrom
Shenkeeee:master
Open

fix(WorkList): fix invalid prop className of type boolean supplied to Button#5921
Shenkeeee wants to merge 2 commits into
OHIF:masterfrom
Shenkeeee:master

Conversation

@Shenkeeee
Copy link
Copy Markdown

@Shenkeeee Shenkeeee commented Mar 25, 2026

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 className of type boolean supplied to Button, expected string"

The cause and fix

boolean && string if boolean is false, causes false to 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

  • open Ohif viewer
  • on Study list, check console. The mentioned warning should not show up.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: Windows 11
  • Node version: v24.11.0
  • Browser: Mozilla/5.0 Gecko/20100101 Firefox/148.0

Greptile Summary

Fixes the PropTypes warning caused by !isValidMode && 'bg-[#222d44]' evaluating to the boolean false when the mode is valid, by replacing it with a ternary that always yields a string ('bg-[#222d44]' or ''). The Button component declares className: 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

Filename Overview
platform/app/src/routes/WorkList/WorkList.tsx Single-line fix replacing boolean && string pattern with a ternary to ensure className always receives a string instead of false.

Reviews (2): Last reviewed commit: "Merge branch 'master' into master" | Re-trigger Greptile

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 25, 2026

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit b10d00b
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/69e20452df5c0d0008068c88
😎 Deploy Preview https://deploy-preview-5921--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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