Skip to content

Commit

Permalink
fix: server-side rendering for dynamic styles
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Mar 29, 2020
1 parent a599c8e commit fabc4af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/glaze/src/useStyling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export function useStyling(): (themedStyle: ThemedStyle) => string {
let appendedClassName = staticClassNames[style];

// Attach a class dynamically if needed
if (!appendedClassName) {
// TODO: Improve support for SSR
if (!appendedClassName && typeof window !== 'undefined') {
// TODO: Use same hashing algorithm during static CSS generation
appendedClassName = `__glaze_${hash(style)}`;
let usageCount = instancesByClassName.get(appendedClassName);
Expand Down

0 comments on commit fabc4af

Please sign in to comment.