frontend: FunctionTabs en plusieurs components
This commit is contained in:
16
website/contexts/FunctionTabsContext.js
Normal file
16
website/contexts/FunctionTabsContext.js
Normal file
@ -0,0 +1,16 @@
|
||||
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;
|
Reference in New Issue
Block a user