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

Type issues with restyle component props #161

Open
jadar opened this issue May 25, 2022 · 1 comment
Open

Type issues with restyle component props #161

jadar opened this issue May 25, 2022 · 1 comment

Comments

@jadar
Copy link

jadar commented May 25, 2022

I noticed that the TypeScript compiler produces an error in the createBox.ts file. At first I thought it was an issue in my code, but a fresh clone and open of restyle has the same issue.

I'm trying to make my own "Box" component for Pressable, so I was following the pattern of Box. I'm concerned because even if it works, I don't think it's a good idea to ship code that doesn't even pass the type-checker—it defeats the whole purpose.
Screen Shot 2022-05-25 at 3 51 32 PM

Type 'BoxProps<Theme, EnableShorthand>' does not satisfy the constraint 'Record<string, unknown>'.
  Type '(BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>) | BaseBoxProps<...>' is not assignable to type 'Record<string, unknown>'.
    Type 'BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>' is not assignable to type 'Record<string, unknown>'.
      Index signature for type 'string' is missing in type 'BackgroundColorProps<Theme> & OpacityProps<Theme> & VisibleProps<Theme> & LayoutProps<Theme> & ... 9 more ... & BackgroundColorShorthandProps<...>'.ts(2344)
@fortmarek
Copy link
Contributor

Could you provide reproduction steps or sample, so we can look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants