Closed chenjiahan closed 2 months ago
Rspress v1.18.1
Page crashes when using with a single as children, for example:
<Tabs> <Tab label="foo">foo</Tab> </Tabs>
Related code: https://github.com/web-infra-dev/rspress/blob/0625b783ca81ea04436320c5a4c6eb837a07944c/packages/theme-default/src/components/Tabs/index.tsx#L57-L60
The children is JSX when there is only a single item. Maybe we should use React.Children.map() instead of children.map
children
React.Children.map()
children.map
this issue war originally reported by @colinaaa ❤️
https://github.com/web-infra-dev/rspress
I will take this
Version
Details
Page crashes when using with a single as children, for example:
Related code: https://github.com/web-infra-dev/rspress/blob/0625b783ca81ea04436320c5a4c6eb837a07944c/packages/theme-default/src/components/Tabs/index.tsx#L57-L60
The
children
is JSX when there is only a single item. Maybe we should useReact.Children.map()
instead ofchildren.map
Reproduce link
https://github.com/web-infra-dev/rspress
Reproduce Steps