Skip to content

Fix isExpanded check in SidebarButton - #8638

Open
mdimamhosen wants to merge 1 commit into
reactjs:mainfrom
mdimamhosen:fix/sidebar-button-isexpanded-condition
Open

Fix isExpanded check in SidebarButton#8638
mdimamhosen wants to merge 1 commit into
reactjs:mainfrom
mdimamhosen:fix/sidebar-button-isexpanded-condition

Conversation

@mdimamhosen

Copy link
Copy Markdown

Description

In SidebarButton.tsx, the expansion chevron arrow condition was checking:
{typeof isExpanded && !heading && (

In JavaScript, typeof isExpanded evaluates to 'boolean' or 'undefined'. Since non-empty strings are truthy in JS (Boolean("undefined") === true), the arrow was rendered even when isExpanded was undefined / not provided.

This PR updates the condition to {isExpanded != null && !heading && (, matching the pattern used in SidebarLink.tsx.

Verification

  • yarn tsc passed (0 errors)
  • yarn prettier:diff passed
  • npx next lint passed
  • yarn test:eslint-local-rules passed

Copilot AI lite review requested due to automatic review settings September 4, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

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.

2 participants