stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.73k stars 249 forks source link

Component composition is broken #1071

Closed marvinklein closed 1 year ago

marvinklein commented 1 year ago

Bug report

Describe the bug

Component composition doesn’t work as expected in this trivial example:

import { styled } from "@stitches/react";

const A = styled("div", { color: "red" });
const B = styled(A, { color: "blue" });
const C = styled(B, { color: "red" });

export default function App() {
  return (
    <>
      <A>is red</A>
      <B>is blue</B>
      <C>expected to be red, but is blue!</C>
    </>
  );
}

To Reproduce

https://codesandbox.io/s/charming-frost-lmqp5y?file=/src/App.js

azuline commented 1 year ago

I think the root cause of this is #1039?

hadihallak commented 1 year ago

Duplicate of https://github.com/stitchesjs/stitches/issues/1039