16 lines
423 B
JavaScript
16 lines
423 B
JavaScript
import React, { createContext, useState } from 'react';
|
|
|
|
export const FunctionTabsContext = createContext();
|
|
|
|
function FunctionTabsContextProvider(props) {
|
|
|
|
const [slideIndex, setSlideIndex] = useState(0);
|
|
|
|
return (
|
|
<FunctionTabsContext.Provider value={{ slideIndex, setSlideIndex }}>
|
|
{props.children}
|
|
</FunctionTabsContext.Provider>
|
|
);
|
|
}
|
|
|
|
export default FunctionTabsContextProvider; |