File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,6 @@ const options: HTMLReactParserOptions = {
216216 }
217217 }
218218
219- // Default tabs variant
220219 const tabs = attributes . tabs
221220 const id =
222221 attributes . id || `tabs-${ Math . random ( ) . toString ( 36 ) . slice ( 2 , 9 ) } `
@@ -230,9 +229,11 @@ const options: HTMLReactParserOptions = {
230229 child instanceof Element && child . name === 'md-tab-panel' ,
231230 )
232231
233- const children = panelElements ?. map ( ( panel ) =>
234- domToReact ( panel . children as any , options ) ,
235- )
232+ const children = panelElements ?. map ( ( panel ) => {
233+ const result = domToReact ( panel . children as any , options )
234+ // Wrap in fragment to ensure it's a single React node
235+ return < > { result } </ >
236+ } )
236237
237238 return < Tabs id = { id } tabs = { tabs } children = { children as any } />
238239 }
Original file line number Diff line number Diff line change @@ -29,17 +29,19 @@ export function Tabs({
2929 const framework = params ?. framework ?? undefined
3030
3131 const [ internalActiveSlug , setInternalActiveSlug ] = React . useState ( ( ) => {
32- const match = framework ? tabsProp . find ( ( tab ) => tab . slug === framework ) : undefined
32+ const match = framework
33+ ? tabsProp . find ( ( tab ) => tab . slug === framework )
34+ : undefined
3335 return match ?. slug ?? tabsProp [ 0 ] ?. slug ?? ''
3436 } )
3537
3638 const activeSlug = controlledActiveSlug ?? internalActiveSlug
3739 const setActiveSlug = React . useCallback (
3840 ( slug : string ) => {
3941 if ( onTabChange ) {
40- onTabChange ( slug ) ;
42+ onTabChange ( slug )
4143 } else {
42- setInternalActiveSlug ( slug ) ;
44+ setInternalActiveSlug ( slug )
4345 }
4446 } ,
4547 [ onTabChange ] ,
Original file line number Diff line number Diff line change @@ -234,7 +234,6 @@ function extractFrameworkData(node: HastNode): FrameworkExtraction | null {
234234
235235 for ( const child of children ) {
236236 if ( isHeading ( child ) ) {
237-
238237 currentFramework = toString ( child as any )
239238 . trim ( )
240239 . toLowerCase ( )
You can’t perform that action at this time.
0 commit comments