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

resolveResponsiveProp can be undefined? #42

Closed
oliverdolgener opened this issue Jul 21, 2023 · 1 comment
Closed

resolveResponsiveProp can be undefined? #42

oliverdolgener opened this issue Jul 21, 2023 · 1 comment

Comments

@oliverdolgener
Copy link

Hey man, thanks again for this amazing lib. We're using it for quite some time now and it works really well.
There is one thing though that I was wondering:

Why can the output of resolveResponsiveProp be undefined?
From your code it seems that it always provides a default.
We're using it with Typescript and that forces us to always write something like that:

const columns = resolveResponsiveProp([2, 3, 4]) || 2;

It's not a big deal but can lead to errors over time. I wish I could just leave the fallback out :)

@mobily
Copy link
Collaborator

mobily commented Apr 8, 2024

thanks for the feedback! since v2 was written in ReScript, some TS types were incorrect, and adding overloading was problematic, v3 fixes that

@mobily mobily closed this as completed Apr 8, 2024
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

No branches or pull requests

2 participants