Skip to content

Commit

Permalink
Fix missing typeof window check in src/base.js (v5) (styled-component…
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten authored and Andrija Plavsa committed Mar 3, 2022
1 parent 2ed6cda commit ec5d34c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/styled-components/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (
}

/* Warning if there are several instances of styled-components */
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && !__SERVER__) {
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && typeof window !== 'undefined') {
window['__styled-components-init__'] = window['__styled-components-init__'] || 0;

if (window['__styled-components-init__'] === 1) {
Expand Down

0 comments on commit ec5d34c

Please sign in to comment.