You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this library within deno inside a React SSR environment, the check introduced in #152 is not enough.
In deno, window is defined and represents the usual globalThis (but document isn't for example), so this "browser check" doesn't work here. Fortunately in this case, the thing this check really should do is to check for window.Element and not just window.
My suggestion would be to replace this:
if (typeof window === 'undefined') {
return;
}
with this:
if (typeof Element === 'undefined') {
return;
}
and I will add a PR for that.
The text was updated successfully, but these errors were encountered:
When using this library within deno inside a React SSR environment, the check introduced in #152 is not enough.
In deno,
window
is defined and represents the usualglobalThis
(butdocument
isn't for example), so this "browser check" doesn't work here. Fortunately in this case, the thing this check really should do is to check forwindow.Element
and not justwindow
.My suggestion would be to replace this:
with this:
and I will add a PR for that.
The text was updated successfully, but these errors were encountered: