Have you read the Contributing Guidelines on issues?
Prerequisites
Description
Using a single TabItem component within a parent Tabs component causes a Uncaught TypeError: children.map is not a function error (this was not the case before the recent 2.3.0 release, as far as I can tell).
With the new release, if I visit /docs/success in the linked example repo, where two TabItem components are nested within a parent Tabs component, then everything works fine:

If, however, I visit /docs/fail, where a single TabItem component is within a parent Tabs component, then the page crashes due to a children.map is not a function error:

Inspecting the console makes it clear why this error is occurring:

After looking at the file containing the offending line of code, I decided to log children and the error became clear.
With a single item:

With two items:

A very superficial hack "resolves" the problem (at least in terms of getting the page not to crash):

Reproducible demo
https://stackblitz.com/edit/github-wahvzn
Steps to reproduce
- Visit the repro link and observe the failure by navigating to
/docs/fail. Then observe the success by visiting /docs/success.
Expected behavior
Continuity in terms of how TabItem components are rendered. Plurality should not matter. There are cases where it may be desirable to use a single TabItem within Tabs such as illustrating how to do things in different coding languages but only having time in the moment to do so for a single language.
Actual behavior
A page should not crash due to the presence of only a single TabItem within Tabs. I can't imagine this was an intentional design decision (since this worked fine in previous versions).
Your environment
Repro demo and source code (made using docusaurus.new): https://stackblitz.com/edit/github-wahvzn?file=docs/fail.md
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.Description
Using a single
TabItemcomponent within a parentTabscomponent causes aUncaught TypeError: children.map is not a functionerror (this was not the case before the recent2.3.0release, as far as I can tell).With the new release, if I visit
/docs/successin the linked example repo, where twoTabItemcomponents are nested within a parentTabscomponent, then everything works fine:If, however, I visit
/docs/fail, where a singleTabItemcomponent is within a parentTabscomponent, then the page crashes due to achildren.map is not a functionerror:Inspecting the console makes it clear why this error is occurring:
After looking at the file containing the offending line of code, I decided to log
childrenand the error became clear.With a single item:
With two items:
A very superficial hack "resolves" the problem (at least in terms of getting the page not to crash):
Reproducible demo
https://stackblitz.com/edit/github-wahvzn
Steps to reproduce
/docs/fail. Then observe the success by visiting/docs/success.Expected behavior
Continuity in terms of how
TabItemcomponents are rendered. Plurality should not matter. There are cases where it may be desirable to use a singleTabItemwithinTabssuch as illustrating how to do things in different coding languages but only having time in the moment to do so for a single language.Actual behavior
A page should not crash due to the presence of only a single
TabItemwithinTabs. I can't imagine this was an intentional design decision (since this worked fine in previous versions).Your environment
Repro demo and source code (made using docusaurus.new): https://stackblitz.com/edit/github-wahvzn?file=docs/fail.md
Self-service