Skip to content

Conversation

aswind7
Copy link
Contributor

@aswind7 aswind7 commented Sep 15, 2025

fix the sponsor link undefined error.

@@ -3,7 +3,7 @@ import './index.css';

export interface Props {
withSponsor?: boolean;
githubName?: typeof withSponsor extends true ? string : never;
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this work anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image image

Yes, the githubName type will be undefined so it throws a type check error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have re-optimized the type definition to accommodate both cases where the "withSponsor" attribute is passed and when it is not. It should be much better now.

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