cssinjs / styled-jss

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

Dynamic import styled-jss #80

Open vietduc1441 opened 3 years ago

vietduc1441 commented 3 years ago

I want to dynamic import "styled-jss" and able to do that so styled-jss become a chunk and only loaded when one of my styled components loaded. For simple case, it works (see sandbox link below)

Expected behavior: +Component selector should work. +Style should cached somehow.

The bug: +Component selector doens't work:

image

+Similar classes generated multiple times: image

Codesandbox: https://codesandbox.io/s/styled-jss-playground-9f5j0?file=/index.js

Versions (please complete the following information):__

Maybe the way i wrapped components is incorrect, if so, could you point me the way so i can fix it.