cssinjs / cssinjs/styled-jss

Dynamic import styled-jss

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
214
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/3817665/90258025-3e275c80-de48-11ea-8f99-63f387a8feaf.png)

+Similar classes generated multiple times:
![image](https://user-images.githubusercontent.com/3817665/90258125-644cfc80-de48-11ea-85ce-93da954f0629.png)

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

Versions (please complete the following information):__
- jss: 10.3.0
- styled-jss: 2.2.3
- Browser: Chrome
- OS: Windows

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.