mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-10-24 03:33:09 +02:00
15 lines
511 B
TypeScript
15 lines
511 B
TypeScript
|
import { createContext, FC, useContext } from 'react';
|
||
|
import { IModToolsContext, ModToolsContextProps } from './ModToolsContext.types';
|
||
|
|
||
|
const ModToolsContext = createContext<IModToolsContext>({
|
||
|
modToolsState: null,
|
||
|
dispatchModToolsState: null
|
||
|
});
|
||
|
|
||
|
export const ModToolsContextProvider: FC<ModToolsContextProps> = props =>
|
||
|
{
|
||
|
return <ModToolsContext.Provider value={ props.value }>{ props.children }</ModToolsContext.Provider>
|
||
|
}
|
||
|
|
||
|
export const useModToolsContext = () => useContext(ModToolsContext);
|