diff --git a/packages/docusaurus-theme-common/package.json b/packages/docusaurus-theme-common/package.json index 2f4f171a5bcf..193c2e9f2b35 100644 --- a/packages/docusaurus-theme-common/package.json +++ b/packages/docusaurus-theme-common/package.json @@ -44,7 +44,6 @@ "parse-numeric-range": "^1.3.0", "prism-react-renderer": "^1.3.5", "tslib": "^2.6.0", - "use-sync-external-store": "^1.2.0", "utility-types": "^3.10.0" }, "devDependencies": { diff --git a/packages/docusaurus-theme-common/src/utils/historyUtils.ts b/packages/docusaurus-theme-common/src/utils/historyUtils.ts index 686a876f84c9..2d896bd25107 100644 --- a/packages/docusaurus-theme-common/src/utils/historyUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/historyUtils.ts @@ -5,10 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import {useCallback, useEffect} from 'react'; +import {useCallback, useEffect, useSyncExternalStore} from 'react'; import {useHistory} from '@docusaurus/router'; -// @ts-expect-error: TODO temporary until React 18 upgrade -import {useSyncExternalStore} from 'use-sync-external-store/shim'; import {useEvent} from './reactUtils'; import type {History, Location, Action} from 'history'; diff --git a/packages/docusaurus-theme-common/src/utils/storageUtils.ts b/packages/docusaurus-theme-common/src/utils/storageUtils.ts index 2bf2461168f6..680dc1c4f721 100644 --- a/packages/docusaurus-theme-common/src/utils/storageUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/storageUtils.ts @@ -5,9 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import {useCallback, useRef} from 'react'; -// @ts-expect-error: TODO temp error until React 18 upgrade -import {useSyncExternalStore} from 'use-sync-external-store/shim'; +import {useCallback, useRef, useSyncExternalStore} from 'react'; const StorageTypes = ['localStorage', 'sessionStorage', 'none'] as const; diff --git a/yarn.lock b/yarn.lock index f30c060036ca..ca116f613614 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16691,11 +16691,6 @@ use-latest@^1.2.1: dependencies: use-isomorphic-layout-effect "^1.1.1" -use-sync-external-store@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" - integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== - util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"