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

Property 'children' is incompatible with index signature TS Error #101

Closed
2 tasks done
richbachman opened this issue Feb 7, 2023 · 7 comments · Fixed by #156
Closed
2 tasks done

Property 'children' is incompatible with index signature TS Error #101

richbachman opened this issue Feb 7, 2023 · 7 comments · Fixed by #156
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@richbachman
Copy link
Contributor

Description

I'm not sure if this is a bug or not but figured I'd post an issue here. I'm running into a TS error when trying to create a Button component from Box. It only seems to happen if I add colorProperties to the createRainbowSprinkles function. You can see the CodeSandbox here: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Box.css.ts:2421-2464

Expected Behaviour

I should be able to add colorProperties to the createRainbowSprinkles function.

Actual Behaviour

The TS error is Property 'children' is incompatible with index signature. You can see that on Button: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Button.tsx

Screenshot 2023-02-07 at 14 49 10

Affected Version

0.15.1

Steps to Reproduce

I've shared the CodeSandbox. You can remove the TS error by commenting out this line: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Box.css.ts:2755-2773

Checklist

@roginfarrer
Copy link
Collaborator

The bug appears to go away if you add the shorthands property to colorProperties. Looks to be a bug with the types!

@roginfarrer roginfarrer added the bug Something isn't working label Feb 7, 2023
@richbachman
Copy link
Contributor Author

richbachman commented Feb 7, 2023

@roginfarrer thanks for taking a look at this so quickly. Sure enough, just adding shorthands: {} fixes the issue. When you say a bug with types, would that be on the library's end or something I'm doing incorrectly?

@roginfarrer
Copy link
Collaborator

It's a bug within rainbow sprinkles

@roginfarrer roginfarrer added the help wanted Extra attention is needed label Apr 7, 2023
@roginfarrer
Copy link
Collaborator

I've looked into this a little bit, but I'm not 100% sure how to solve it 🤔 . Would love some help on this one.

@roginfarrer
Copy link
Collaborator

roginfarrer commented Jan 2, 2024

I think I may have fixed this issue. @richbachman can you try installing this version and see if it fixes it for you?

0.0.0-reorder-defineproperties-overload-types-20240102060747

@roginfarrer
Copy link
Collaborator

Went ahead and merged it since I'm pretty confident it fixes the issue in my testing. Will release in a patch shortly.

@richbachman
Copy link
Contributor Author

@roginfarrer Apologies for falling off the radar on this one. Work has been busy and my brain is playing catch up. Thanks for looking into this. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants