From 9424e4dc5ac986b668429eeb93d7f79468870a06 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 25 Sep 2023 14:21:19 +0200 Subject: [PATCH] Revert "Remove `index.js` suffix of `use-sync-external-store/shim` to support React Native (#2767)" This reverts commit a2bb5ae5df783c9b293c8ca1b4ef66a621d7d04e. --- 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$'