Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[types] permit undefined createContext initial value #3407

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

developit
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented Jan 11, 2022

Coverage Status

Coverage remained the same at 99.625% when pulling b6053a1 on types-createcontext-default-value into d4a3013 on master.

@@ -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>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants