fix: update Tabs API for Docusaurus 3.10.0 compatibility#1398
Merged
Conversation
Docusaurus 3.10.0 refactored the internal Tabs system to use React context (facebook/docusaurus#11733), breaking all custom tab components. - Replace useTabs(props) with useTabsContextValue(props) + TabsProvider - Remove cloneElement hidden prop injection (TabItem self-manages via context) - Consolidate imports to @docusaurus/theme-common/internal (deep lib/ paths are now restricted by the package exports field) - Update ambient type declarations in theme-classic.d.ts - Bump Docusaurus peerDeps/devDeps to ^3.10.0 Closes #1395 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit e26e287): https://docusaurus-openapi-36b86--pr1398-sugo4t7o.web.app (expires Wed, 15 Apr 2026 02:38:27 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
With TabItem now self-managing visibility via context, the cloneElement call that only injected key was dead weight. Render children directly instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ApiTabs,SchemaTabs,MimeTabs,OperationTabs,DiscriminatorTabs,CodeTabs) to the new Tabs context API introduced in Docusaurus 3.10.0 (facebook/docusaurus#11733)useTabs(props)withuseTabsContextValue(props)+<TabsProvider>wrappercloneElementhidden prop injection —TabItemnow self-manages visibility via context@docusaurus/theme-common/internal(deeplib/paths are restricted by the packageexportsfield in 3.10.0)theme-classic.d.ts^3.5.0to^3.10.0Breaking Change
This is a breaking change — the minimum supported Docusaurus version is now
3.10.0. Users on3.9.xand below must upgrade Docusaurus before updating this package.Test plan
docusaurus-plugin-openapi-docsbuilds successfullydocusaurus-theme-openapi-docsbuilds successfullyCloses #1395
🤖 Generated with Claude Code