i am trying to make a context with hooks in react in typescript like this:
interface SettingsStateContextProps {
sort: string;
type: string;
price: string;
option_full: boolean;
option_rated: boolean;
option_free: boolean;
}
export const SettingsStateContext = React.createContext<
Partial<SettingsStateContextProps>
>({});
export const SettingsStoreProvider:any = ({ reducer, initialState, children }):any => (
<SettingsStateContext.Provider // ERROR HERE
value={useReducer(reducer, initialState)}
children={children}
/>
);
but for some reason i don't know why I cannot declare SettingsStateContext.Provider? I am getting an error message with
'Cannot find namespace 'SettingsStateContext'
How do i fix this?