Skip to content

Conversation

ocavue
Copy link

@ocavue ocavue commented Sep 24, 2025

Any non-string values passed to clsx/lite are intentionally ignored, thus passing arrays or objects to it is likely an error.

// NOTE: Any non-string input(s) ignored
clsx({ foo: true });

Currently, clsx and clsx/lite use the same type declaration, resulting in these user errors not being identified by type checking.

This pull request introduces a new type declaration for clsx/lite. In comparison to the previous declaration, the follow argument types are still accectped:

  • string | boolean | undefined | null

and the following types are not accepted anymore:

  • ClassArray | ClassDictionary | number | bigint

This should help catch user errors.

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.

1 participant