threepointone/glamor

Insert global css after rehydrate recommended?

electerious opened this issue · 1 comments

Is it recommended to call css.insert for global css after glamor has been rehydrated on the client, when the server has been called css.insert already?

Both of the following scenarios work. I just wonder if there's a difference between them.

Scenario 1:

  • Server
    • Insert global css with css.insert
    • Output HTML with style and glamor state
  • Client
    • Rehydrate from state

Scenario 2:

  • Server
    • Insert global css with css.insert
    • Output HTML with style and glamor state
  • Client
    • Rehydrate from state
    • Insert global css with css.insert (same as on the server)

You don't have to worry, glamor will make sure to dedupe and prevent redundant rules as long as you rehydrated correctly