@@ -8,7 +8,7 @@ import { ApiContext, StateContext, ForceUpdateContext } from "../utils/context.j
88function useDynamicTabs ( options ) {
99 const ref = useRef ( null ) ;
1010 if ( ref . current === null )
11- ref . current = { api : new ( Api ) ( { options } ) , TabListComponent : null , PanelListCompoent : null } ;
11+ ref . current = { api : new ( Api ) ( { options } ) , TabListComponent : null , PanelListComponent : null } ;
1212 const { current : { api } } = ref
1313 , _ref = ref . current
1414 , [ state , dispatch ] = useReducer ( reducer , api . getInitialState ( ) ) ;
@@ -29,9 +29,9 @@ function useDynamicTabs(options) {
2929 if ( ! _ref . TabListComponent )
3030 _ref . TabListComponent = ( props = { } ) => {
3131 return (
32- < ApiContext . Provider value = { _ref . api } >
33- < StateContext . Provider value = { _ref . api . stateRef } >
34- < ForceUpdateContext . Provider value = { _ref . api . forceUpdateState } >
32+ < ApiContext . Provider value = { api } >
33+ < StateContext . Provider value = { api . stateRef } >
34+ < ForceUpdateContext . Provider value = { api . forceUpdateState } >
3535 < TabList { ...props } > props.children</ TabList >
3636 </ ForceUpdateContext . Provider >
3737 </ StateContext . Provider >
@@ -40,14 +40,14 @@ function useDynamicTabs(options) {
4040 } ;
4141 if ( ! _ref . PanelListCompoent )
4242 _ref . PanelListCompoent = props => (
43- < ApiContext . Provider value = { _ref . api } >
44- < StateContext . Provider value = { _ref . api . stateRef } >
45- < ForceUpdateContext . Provider value = { _ref . api . forceUpdateState } >
43+ < ApiContext . Provider value = { api } >
44+ < StateContext . Provider value = { api . stateRef } >
45+ < ForceUpdateContext . Provider value = { state } >
4646 < PanelList { ...props } > props.children</ PanelList >
4747 </ ForceUpdateContext . Provider >
4848 </ StateContext . Provider >
4949 </ ApiContext . Provider >
5050 ) ;
51- return [ _ref . TabListComponent , _ref . PanelListCompoent , _ref . api . userProxy ] ;
51+ return [ _ref . TabListComponent , _ref . PanelListCompoent , api . userProxy ] ;
5252}
5353export default useDynamicTabs ;
0 commit comments