This error is due to the fact that type "null" is not destructurable at: const AuthContext = createContext<AppContext | null>(null);
A better approach is to assign the default value an empty object and declaring its type as the context type (AppContext):
const AuthContext = createContext< AppContext > ({} as AppContext);
Happy coding!