Skip to content

Commit 6891f89

Browse files
authored
fix: add server check back for rAF (#899)
1 parent 7074ac3 commit 6891f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/use-swr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ function useSWR<Data = any, Error = any>(
577577
config.revalidateOnMount ||
578578
(!config.initialData && config.revalidateOnMount === undefined)
579579
) {
580-
if (typeof latestKeyedData !== 'undefined') {
580+
if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
581581
// delay revalidate if there's cache
582582
// to not block the rendering
583583
rAF(softRevalidate)

0 commit comments

Comments
 (0)