I encountered an issue related to the error
property within the defaultState
constant:
interface AuthState<T = any> {
auth: T;
error: null | Error;
loading: boolean;
}
export const defaultState: { auth: null | AuthState } = {
auth: null,
error: null, // This is where the problem occurs
loading: false
};
The specific error message reads as follows:
TS2322: Type '{ auth: null; error: null; loading: boolean; }' is not assignable to type '{ auth: AuthState<any> | null; }'. Object literal may only specify known properties, and 'error' does not exist in type '{ auth: AuthState<any> | null; }'.
I'm struggling to resolve this typing issue, any suggestions or hints would be greatly appreciated.