@@ -3,8 +3,10 @@ import React, {useState, useReducer, useLayoutEffect, useRef} from 'react';
33function useDynamicTabs ( getDeps , options = { } , modules ) {
44 const { reducer, getApiInstance, ApiContext, StateContext, ForceUpdateContext, Components} = getDeps ( ) ;
55 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+ }
810 const {
911 current : { api} ,
1012 } = ref ,
@@ -44,14 +46,14 @@ function useDynamicTabs(getDeps, options = {}, modules) {
4446 < ApiContext . Provider value = { api } >
4547 < StateContext . Provider value = { api . stateRef } >
4648 < 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 >
5355 { props . children }
54- </ Components . TablistView >
56+ </ _ref . Components . TablistView >
5557 </ ForceUpdateContext . Provider >
5658 </ StateContext . Provider >
5759 </ ApiContext . Provider >
0 commit comments