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

[typescript] Sx properties should accept booleans #1297

Closed
Ericnr opened this issue Nov 25, 2020 · 1 comment · Fixed by #1460
Closed

[typescript] Sx properties should accept booleans #1297

Ericnr opened this issue Nov 25, 2020 · 1 comment · Fixed by #1460
Labels
bug Something isn't working types

Comments

@Ericnr
Copy link

Ericnr commented Nov 25, 2020

It's very important that the sx properties are typed so that you can write sx={{ color: isActive && 'blue' }}. It does behaves correctly when a boolean is passed, the property is simply ignored, it's only a typescript since it expects only strings.

@hasparus
Copy link
Member

Fair point. We should accept false in place of null and undefined for convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types
Projects
None yet
2 participants