why I get this ts error:
Cannot invoke an object which is possibly 'null'.
Context.tsx
import React, { createContext, useState } from 'react';type ForgotPasswordProviderProps = { children: React.ReactNode;}export type Email = { email: string | null; setEmail: React.Dispatch<React.SetStateAction<string>> | null;}export const ForgotPasswordContext = createContext<Email | null>(null);export const ForgotPasswordContextProvider = ({ children}: ForgotPasswordProviderProps) => { const [email, setEmail] = useState(''); return <ForgotPasswordContext.Provider value={{email, setEmail}}>{children}</ForgotPasswordContext.Provider>}
ForgotPassword.tsx
const handleChangeEmail = (e: string) => (emailContext && emailContext.setEmail('asas');
this error comes on line: emailContext.setEmail
How can I solve this issue ?