mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-10-24 11:43:07 +02:00
18 lines
446 B
TypeScript
18 lines
446 B
TypeScript
|
import { createContext, FC, ProviderProps, useContext } from 'react';
|
||
|
|
||
|
export interface IGridContext
|
||
|
{
|
||
|
isCssGrid: boolean;
|
||
|
}
|
||
|
|
||
|
const GridContext = createContext<IGridContext>({
|
||
|
isCssGrid: false
|
||
|
});
|
||
|
|
||
|
export const GridContextProvider: FC<ProviderProps<IGridContext>> = props =>
|
||
|
{
|
||
|
return <GridContext.Provider value={ props.value }>{ props.children }</GridContext.Provider>
|
||
|
}
|
||
|
|
||
|
export const useGridContext = () => useContext(GridContext);
|