macaron-css / macaron

Compiler-augmented typesafe CSS-in-JS with zero runtime, colocation, maximum safety and productivity
https://macaron.js.org/
MIT License
735 stars 16 forks source link

Composing Components Type Error "... is not assignable to parameter of type 'string'" #15

Closed zwgnr closed 1 year ago

zwgnr commented 1 year ago

In Stiches you can compose components from other elements, i.e. where MyCoolElement is another component.

Currently in Macaron it will throw a type error "... is not assignable to parameter of type 'string'"

The functionality still works and I have just been using //@ts-expect-error but thats not ideal.

const Button = styled(MyCoolElement, {
  base: {
    backgroundColor: 'gainsboro',
  },
});
Mokshit06 commented 1 year ago

Hi @zwagnr, thanks for noticing this. Are you using the solid or the react adapter?

zwgnr commented 1 year ago

React!

Mokshit06 commented 1 year ago

Can you send a minimal reproduction of this? I tried this and it seems to work for me

kavinvalli commented 1 year ago

Can you send a minimal reproduction of this? I tried this and it seems to work for me

Seems to be working for me as well

zwgnr commented 1 year ago

It "works" for me as well, just throws the type error. Is it not giving you a type error?

I'm traveling all weekend so I'll try to send a CodeSandbox as soon as I can!

Mokshit06 commented 1 year ago

I believe this issue is fixed in the new versions, so closing it. Feel free to open them if you face it again!