import React from 'react'; import {createContext, ReactNode, useContext, useState} from 'react'; interface IValueProps { agree?: boolean; } export interface ITncProps { value: IValueProps; setValue: (data: IValueProps) => void; } const contextDefaultValues: ITncProps = { value: {agree: false}, setValue: (data: IValueProps) => data, }; const TncContext = createContext(contextDefaultValues); export const TncProvider = ({children}: {children: ReactNode}) => { const [value, setValue] = useState(contextDefaultValues.value); return ( {children} ); }; export default () => useContext(TncContext);