Commit 136075f
fix(theme): scope inner CodeTabs defaultValue to current language's samples
The inner x-codeSamples CodeTabs was passing the global selectedSample
state as defaultValue for every outer language tab. When selectedSample
held an id from a different language (e.g. "Python-KeyPair Auth" while
rendering the C# tab), Docusaurus's <Tabs> validation threw:
"<Tabs> has a defaultValue 'Python-KeyPair Auth' but none of its
children has the corresponding value. Available values are: C#-0."
Guard the defaultValue so each language's inner tabs only adopt
selectedSample when the id belongs to that language's samples;
otherwise fall back to the language's first sample.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 507f7d7 commit 136075f
1 file changed
Lines changed: 5 additions & 1 deletion
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
300 | 304 | | |
301 | 305 | | |
302 | 306 | | |
| |||
0 commit comments