We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1931cf commit 196e5b8Copy full SHA for 196e5b8
1 file changed
src/components/markdown/PackageManagerTabs.tsx
@@ -52,9 +52,14 @@ export function PackageManagerTabs({
52
'react') as Framework
53
54
const normalizedFramework = actualFramework.toLowerCase()
55
- const packageGroups = packagesByFramework[normalizedFramework]
+ const fallbackFramework = Object.keys(packagesByFramework).find(
56
+ (framework) => packagesByFramework[framework]?.length,
57
+ )
58
+ const packageGroups =
59
+ packagesByFramework[normalizedFramework] ||
60
+ (fallbackFramework ? packagesByFramework[fallbackFramework] : undefined)
61
- // Hide component if current framework not in package list
62
+ // Fall back to the first available framework so single-framework content still renders.
63
if (!packageGroups || packageGroups.length === 0) {
64
return null
65
}
0 commit comments