@@ -3,8 +3,10 @@ import React, {useState, useReducer, useLayoutEffect, useRef} from 'react';
3
3
function useDynamicTabs ( getDeps , options = { } , modules ) {
4
4
const { reducer, getApiInstance, ApiContext, StateContext, ForceUpdateContext, Components} = getDeps ( ) ;
5
5
const ref = useRef ( null ) ;
6
- if ( ref . current === null )
7
- ref . current = { api : getApiInstance ( options , modules , Components ) , TabListComponent : null , PanelListComponent : null } ;
6
+ if ( ref . current === null ) {
7
+ ref . current = { Components : { ...Components } , TabListComponent : null , PanelListComponent : null } ;
8
+ ref . current . api = getApiInstance ( options , modules , ref . current . Components ) ;
9
+ }
8
10
const {
9
11
current : { api} ,
10
12
} = ref ,
@@ -44,14 +46,14 @@ function useDynamicTabs(getDeps, options = {}, modules) {
44
46
< ApiContext . Provider value = { api } >
45
47
< StateContext . Provider value = { api . stateRef } >
46
48
< ForceUpdateContext . Provider value = { api . forceUpdateState } >
47
- < Components . TablistView >
48
- < Components . TablistContainer >
49
- < Components . TablistOverflow >
50
- < Components . TabList { ...props } > </ Components . TabList >
51
- </ Components . TablistOverflow >
52
- </ Components . TablistContainer >
49
+ < _ref . Components . TablistView >
50
+ < _ref . Components . TablistContainer >
51
+ < _ref . Components . TablistOverflow >
52
+ < _ref . Components . TabList { ...props } > </ _ref . Components . TabList >
53
+ </ _ref . Components . TablistOverflow >
54
+ </ _ref . Components . TablistContainer >
53
55
{ props . children }
54
- </ Components . TablistView >
56
+ </ _ref . Components . TablistView >
55
57
</ ForceUpdateContext . Provider >
56
58
</ StateContext . Provider >
57
59
</ ApiContext . Provider >
0 commit comments