Skip to content

Dynamic import styled-jss #80

@vietduc1441

Description

@vietduc1441

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):__

  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions