diff --git a/src/use-swr.ts b/src/use-swr.ts index fb09e9325..a045e665f 100644 --- a/src/use-swr.ts +++ b/src/use-swr.ts @@ -299,10 +299,8 @@ function useSWR( // we don't have an error newState.error = undefined } - if (config.compare(stateRef.current.data, newData)) { + if (!config.compare(stateRef.current.data, newData)) { // deep compare to avoid extra re-render - // do nothing - } else { // data changed newState.data = newData }