Currently, this usage doesn't have proper types for factory functions:
<View
sx={{ p: theme => theme.space.$2 }}
/>
This usage does have the correct types, on the other hand:
<View
sx={theme => ({ p: theme.space.$2 })}
/>
However, this isn't good enough for many use-cases. If you want to create a wrapper component that spreads its sx styles directly on the props, then you can't use the sx prop with a theme:
Currently, this usage doesn't have proper types for factory functions:
This usage does have the correct types, on the other hand:
However, this isn't good enough for many use-cases. If you want to create a wrapper component that spreads its
sx
styles directly on the props, then you can't use thesx
prop with a theme: