Skip to content

refactor: render null instead of empty fragment when hideTabs is true (#770)#771

Merged
NoopDog merged 2 commits intomainfrom
copilot/refactor-hide-tabs-rendering
Feb 10, 2026
Merged

refactor: render null instead of empty fragment when hideTabs is true (#770)#771
NoopDog merged 2 commits intomainfrom
copilot/refactor-hide-tabs-rendering

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Closes #770.

In EntityDetailView, the Tabs prop conditionally rendered an empty fragment when hideTabs is true. Changed to render null instead, following React's standard pattern for conditional rendering.

Changes

  • src/views/EntityDetailView/entityDetailView.tsx: Replace <></> with null in Tabs prop ternary
// Before
Tabs={
  hideTabs ? (
    <></>
  ) : (
    <Tabs onTabChange={onTabChange} tabs={tabs} value={tabRoute} />
  )
}

// After  
Tabs={
  hideTabs ? null : (
    <Tabs onTabChange={onTabChange} tabs={tabs} value={tabRoute} />
  )
}
Original prompt

This section details on the original issue you should resolve

<issue_title>refactor: render null instead of empty fragment when hideTabs is true</issue_title>
<issue_description>## Summary

In EntityDetailView, when hideTabs is true, the Tabs prop currently renders an empty fragment <></>. This should be changed to render null instead, which is the preferred React pattern for conditionally rendering nothing.

Current Code

Tabs={
  hideTabs ? (
    <></>
  ) : (
    <Tabs onTabChange={onTabChange} tabs={tabs} value={tabRoute} />
  )
}

Proposed Change

Tabs={
  hideTabs ? null : (
    <Tabs onTabChange={onTabChange} tabs={tabs} value={tabRoute} />
  )
}

File Location

src/views/EntityDetailView/entityDetailView.tsx (line 82)

Why

  • null is the idiomatic React way to render nothing
  • Avoids creating an unnecessary empty fragment node
  • Cleaner and more explicit intent</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Refactor render null instead of empty fragment when hideTabs is true refactor: render null instead of empty fragment when hideTabs is true Feb 10, 2026
Copilot AI requested a review from frano-m February 10, 2026 05:39
@frano-m frano-m changed the title refactor: render null instead of empty fragment when hideTabs is true refactor: render null instead of empty fragment when hideTabs is true (#770) Feb 10, 2026
Copy link
Contributor

@frano-m frano-m left a comment

Choose a reason for hiding this comment

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

LGTM @copilot thank you.

@frano-m frano-m marked this pull request as ready for review February 10, 2026 05:42
@NoopDog NoopDog merged commit 62733b7 into main Feb 10, 2026
2 checks passed
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.

Render null instead of empty fragment when hideTabs is true

3 participants