From a2bb5ae5df783c9b293c8ca1b4ef66a621d7d04e Mon Sep 17 00:00:00 2001 From: Malash Date: Sun, 10 Sep 2023 16:05:32 +0800 Subject: [PATCH] Remove `index.js` suffix of `use-sync-external-store/shim` to support React Native (#2767) remove `index.js` suffix to support React Native and fix #2402 --- 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 8480ea805..2d40dc85a 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/index.js' +import { useSyncExternalStore } from 'use-sync-external-store/shim' import { defaultConfig, diff --git a/infinite/src/index.ts b/infinite/src/index.ts index 58089f31c..ce74fb074 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/index.js' +import { useSyncExternalStore } from 'use-sync-external-store/shim' import { getFirstPageKey } from './serialize' // const INFINITE_PREFIX = '$inf$'