Skip to content

Commit 0d61d99

Browse files
Xshuding
X
andauthored
refactor: support SSR in Deno (#754)
* refactor: support SSR in Deno * refactor: improve Deno determining * Add @ts-ignore Co-authored-by: Shu Ding <[email protected]> Co-authored-by: Shu Ding <[email protected]>
1 parent 5dbd6d5 commit 0d61d99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/use-swr.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
updaterInterface
2525
} from './types'
2626

27-
const IS_SERVER = typeof window === 'undefined'
27+
// @ts-ignore
28+
const IS_SERVER = typeof window === 'undefined' || !!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno)
2829

2930
// polyfill for requestAnimationFrame
3031
const rAF = IS_SERVER

0 commit comments

Comments
 (0)