mirror of
https://github.com/zhigang1992/styled-components.git
synced 2026-04-28 17:25:54 +08:00
fix(ssr): fix 'window' undefined reference error
This commit is contained in:
@@ -4,7 +4,12 @@
|
||||
declare var window: { __webpack_nonce__: string };
|
||||
|
||||
const getNonce = () => {
|
||||
return typeof window.__webpack_nonce__ !== 'undefined' ? window.__webpack_nonce__ : null;
|
||||
|
||||
return typeof window !== 'undefined'
|
||||
? typeof window.__webpack_nonce__ !== 'undefined'
|
||||
? window.__webpack_nonce__
|
||||
: null
|
||||
: null;
|
||||
};
|
||||
|
||||
export default getNonce;
|
||||
|
||||
Reference in New Issue
Block a user