Skip to content

Commit f393057

Browse files
Adebesin-Cellclaude
andcommitted
fix: remove useId() and ClientOnly from DownloadButton
useId() inside ClientOnly causes server/client ID counter desync, leading to hydration mismatches. Replace with a static ID since there's only one download menu per page. Remove ClientOnly wrapper as the component doesn't do any fetching until user interaction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 60aac4a commit f393057

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

app/components/Package/DownloadButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const highlightedIndex = shallowRef(-1)
2121
const dropdownPosition = shallowRef<{ top: number; right: number } | null>(null)
2222
2323
const { t } = useI18n()
24-
const menuId = useId()
24+
const menuId = 'download-menu'
2525
const menuItems = computed(() => {
2626
const items = [{ id: 'package', label: t('package.download.package'), icon: 'i-lucide:package' }]
2727
if (props.installSize) {

app/pages/package/[[org]]/[name].vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -773,15 +773,13 @@ const showSkeleton = shallowRef(false)
773773
</h2>
774774
<!-- Package manager dropdown + Download button -->
775775
<div class="flex items-center gap-2">
776-
<ClientOnly>
777-
<PackageDownloadButton
778-
v-if="displayVersion"
779-
:package-name="pkg.name"
780-
:version="displayVersion"
781-
:install-size="installSize ?? null"
782-
size="small"
783-
/>
784-
</ClientOnly>
776+
<PackageDownloadButton
777+
v-if="displayVersion"
778+
:package-name="pkg.name"
779+
:version="displayVersion"
780+
:install-size="installSize ?? null"
781+
size="small"
782+
/>
785783
<PackageManagerSelect />
786784
</div>
787785
</div>

0 commit comments

Comments
 (0)