From da489ef7d63d1aa3448219bc5e562293f5f1ee60 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 25 Sep 2023 14:28:14 +0200 Subject: [PATCH] Revert "Remove `index.js` suffix of `use-sync-external-store/shim` to support React Native" (#2802) --- core/src/use-swr.ts | 2 +- infinite/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/use-swr.ts b/core/src/use-swr.ts index 2d40dc85a..8480ea805 100644 --- a/core/src/use-swr.ts +++ b/core/src/use-swr.ts @@ -5,7 +5,7 @@ import ReactExports, { useDebugValue, useMemo } from 'react' -import { useSyncExternalStore } from 'use-sync-external-store/shim' +import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js' import { defaultConfig, diff --git a/infinite/src/index.ts b/infinite/src/index.ts index c2ae16cf0..d51b8eaa4 100644 --- a/infinite/src/index.ts +++ b/infinite/src/index.ts @@ -33,7 +33,7 @@ import type { SWRInfiniteCacheValue, SWRInfiniteCompareFn } from './types' -import { useSyncExternalStore } from 'use-sync-external-store/shim' +import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js' import { getFirstPageKey } from './serialize' // const INFINITE_PREFIX = '$inf$'