Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@ export interface Context<T> {
}
export interface PreactContext<T> extends Context<T> {}

export function createContext<T>(defaultValue: T): Context<T>;
export function createContext<T = undefined>(defaultValue: T): Context<T>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this?

Suggested change
export function createContext<T = undefined>(defaultValue: T): Context<T>;
export function createContext<T>(defaultValue: T): Context<T>;
export function createContext<T extends undefined>(defaultValue?: T): Context<T>;