Theme-ui: [typescript] Sx properties should accept booleans

Created on 25 Nov 2020  路  1Comment  路  Source: system-ui/theme-ui

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.

bug types

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tesseralis picture tesseralis  路  3Comments

VinSpee picture VinSpee  路  3Comments

vojtaholik picture vojtaholik  路  3Comments

folz picture folz  路  3Comments

george-norris-salesforce picture george-norris-salesforce  路  3Comments