cssinjs / styled-jss

Styled Components on top of JSS.
http://cssinjs.org/styled-jss
MIT License
217 stars 25 forks source link

Bug: Nested composition causes invalid tag to be rendered #67

Closed aloker closed 6 years ago

aloker commented 6 years ago

Consider this example:

const C1 = ({ children }) => <div>{children}</div>;
const C2 = styled(C1)({});
const C3 = styled(C2)({});

const App = () => <C3>Test</C3>

That is, styled element C3 extends styled element C2 which by itself extends component C1.

This causes a wrong DOM element to be rendered (notice the c1 tag): <c1 class="C1-2-0-1">Test</c1>

Online example

If I replace C1 with a styled element by itself (const C1 = styled('div')({...})), the generated DOM is correct.

lttb commented 6 years ago

fixed in 2.2.3