Skip to content

Commit

Permalink
check if document is not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
beerose committed Jun 18, 2022
1 parent 9b9310e commit 5753181
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export function mountStoreDevtool(
};

(ZustandDevtool as any).displayName = `((${storeName})) devtool`;


if (typeof document === 'undefined') {
return;
}

if (!rootElement) {
let root = document.getElementById(`simple-zustand-devtools-${storeName}`);
if (!root) {
Expand Down

0 comments on commit 5753181

Please sign in to comment.