Replies: 1 comment 4 replies
|
What do you mean by generic? To pass your desired type to the Hook? useCSSVariable<string>('--color-primary') |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Current
useCSSVariablesreturnstring | number | undefinedi get that you can't know if user is asking for a string or a number and if you might find it but user should know and letting us with generic for the type would solve some typescript issues.
For example expo-router Stack don't accept those types for style:
throw a warning, i can do
as stringbut i feel like having generic is more "clean" if that makes sense and also if at some point you can determine the type based on the token asked, generic would get remove and i would know while as string might not tell me.All reactions