Cách mở rộng interface Options trong axios-hooks một ví dụ quá hay (ok)


PreviousProperty 'error' does not exist on type 'Session' (ok)NextKiểu Generics là gì hãy giải thích rõ và vĩ dụ giúp tôi dễ hiểu?
Last updated


Last updated
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
interface Post {
id: number;
title: string;
body: string;
}
import 'axios-hooks';
declare module 'axios-hooks' {
export interface Options {
initialData?: Post[]; // Thêm thuộc tính mới
}
}